Page MenuHomeSoftware Heritage

Install app_label on add_forge_now model classes
ClosedPublic

Authored by ardumont on Mar 29 2022, 9:28 AM.

Details

Summary

This should alleviate problems in documentation build.

Related to D7445

Diff Detail

Repository
rDWAPPS Web applications
Branch
master
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 27974
Build 43806: Phabricator diff pipeline on jenkinsJenkins console · Jenkins
Build 43805: arc lint + arc unit

Event Timeline

Build has FAILED

Patch application report for D7446 (id=26956)

Rebasing onto 4bc8aaf1d9...

Current branch diff-target is up to date.
Changes applied before test
commit 2531af642f005897b208255221a052ac41795c3a
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Tue Mar 29 09:25:24 2022 +0200

    Install app_label on add_forge_now model classes
    
    This should alleviate problems in documentation build.

Link to build: https://jenkins.softwareheritage.org/job/DWAPPS/job/tests-on-diff/1605/
See console output for more information: https://jenkins.softwareheritage.org/job/DWAPPS/job/tests-on-diff/1605/console

Harbormaster returned this revision to the author for changes because remote builds failed.Mar 29 2022, 9:30 AM
Harbormaster failed remote builds in B27872: Diff 26956!

Build has FAILED

Patch application report for D7446 (id=26956)

Rebasing onto 4bc8aaf1d9...

Current branch diff-target is up to date.
Changes applied before test
commit 2531af642f005897b208255221a052ac41795c3a
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Tue Mar 29 09:25:24 2022 +0200

    Install app_label on add_forge_now model classes
    
    This should alleviate problems in documentation build.

Link to build: https://jenkins.softwareheritage.org/job/DWAPPS/job/tests-on-diff/1606/
See console output for more information: https://jenkins.softwareheritage.org/job/DWAPPS/job/tests-on-diff/1606/console

What a mess... but it works locally now...

Please just set the app label in each Model's Meta class rather than use inheritance.

Please just set the app label in each Model's Meta class rather than use inheritance.

fine.

Please just set the app label in each Model's Meta class rather than use inheritance.

fine.

well, if that adaptation change (without inheritance) it's willing to work that is...

Build was aborted

Patch application report for D7446 (id=26968)

Could not rebase; Attempt merge onto 4bc8aaf1d9...

Updating 4bc8aaf1..c5825f74
Fast-forward
 swh/web/add_forge_now/apps.py                          |  4 +++-
 .../migrations/0004_auto_20220329_0844.py              | 15 +++++++++++++++
 swh/web/add_forge_now/models.py                        | 18 ++++++++++++++++--
 swh/web/inbound_email/management/__init__.py           |  0
 swh/web/inbound_email/management/commands/__init__.py  |  0
 5 files changed, 34 insertions(+), 3 deletions(-)
 create mode 100644 swh/web/add_forge_now/migrations/0004_auto_20220329_0844.py
 create mode 100644 swh/web/inbound_email/management/__init__.py
 create mode 100644 swh/web/inbound_email/management/commands/__init__.py
Changes applied before test
commit c5825f7487c87f87c3ae965bcb38b0a8cd738bba
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Tue Mar 29 09:25:24 2022 +0200

    Install app_label on add_forge_now model classes
    
    This should alleviate problems in documentation build.
    
    This triggers a necessary noop migration otherwise django tools are not happy.

commit 0c1e63d70261d917be5f4c3400772c6864e6cb56
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Tue Mar 29 09:50:12 2022 +0200

    swh.web.inbound_email: Add missing __init__.py file
    
    My hypothesis is that those missing files are making the swh-docs build fail.
    That's the only difference i see between those swh.web folders and the rest.

Link to build: https://jenkins.softwareheritage.org/job/DWAPPS/job/tests-on-diff/1613/
See console output for more information: https://jenkins.softwareheritage.org/job/DWAPPS/job/tests-on-diff/1613/console

Harbormaster returned this revision to the author for changes because remote builds failed.Mar 29 2022, 11:11 AM
Harbormaster failed remote builds in B27884: Diff 26968!

Build was aborted

*sigh*
opened D7450 for this.

works locally

=========================================================================================== 704 passed, 5 skipped, 18 warnings in 148.75s (0:02:28) ===========================================================================================

Please just set the app label in each Model's Meta class rather than use inheritance.

fine.

well, if that adaptation change (without inheritance) it's willing to work that is...

Doing as you suggest plainly refuse to work at all (it was also my initial attempt btw...).

Modifying the model implies a migration even if it's a noop.
Without it, tests fails:

$ pytest -vv -x -s ./swh/web/tests/test_migrations.py
...
FAILED swh/web/tests/test_migrations.py::test_migrations_09_add_visit_status_to_sor_model - django.db.utils.ProgrammingError: relation "add_forge_now_request" already exists
ERROR swh/web/tests/test_migrations.py::test_migrations_09_add_visit_status_to_sor_model - django.db.utils.ProgrammingError: relation "add_forge_now_request" already exists

Triggering the migration creation and then for some reason, django makemigration only creates a
migration script which destroys both table Request and RequestHistory (T.T).

$ django-admin makemigrations --settings swh.web.settings.development
Migrations for 'add_forge_now':
  swh/web/add_forge_now/migrations/0004_auto_20220329_1026.py
    - Remove field request from requesthistory
    - Delete model Request
    - Delete model RequestHistory

(which is fine for the previous failing tests on migration since it's not tested but it's awfully wrong with the actual add-forge-now tests)

$ pytest -vv -s ./swh/web/tests/api/views/test_add_forge_now.py
...

FAILED swh/web/tests/api/views/test_add_forge_now.py::test_add_forge_request_create_success_post[add_forge_data0] - AssertionError: Traceback (most recent call last):
FAILED swh/web/tests/api/views/test_add_forge_now.py::test_add_forge_request_create_success_post[add_forge_data1] - AssertionError: Traceback (most recent call last):
FAILED swh/web/tests/api/views/test_add_forge_now.py::test_add_forge_request_create_success_post[add_forge_data2] - AssertionError: Traceback (most recent call last):
FAILED swh/web/tests/api/views/test_add_forge_now.py::test_add_forge_request_create_success_post[add_forge_data3] - AssertionError: Traceback (most recent call last):
FAILED swh/web/tests/api/views/test_add_forge_now.py::test_add_forge_request_create_success_form_encoded - AssertionError: Traceback (most recent call last):
FAILED swh/web/tests/api/views/test_add_forge_now.py::test_add_forge_request_create_duplicate - AssertionError: Traceback (most recent call last):
FAILED swh/web/tests/api/views/test_add_forge_now.py::test_add_forge_request_update_non_existent - AssertionError: Traceback (most recent call last):
FAILED swh/web/tests/api/views/test_add_forge_now.py::test_add_forge_request_update_empty - AssertionError: Traceback (most recent call last):
FAILED swh/web/tests/api/views/test_add_forge_now.py::test_add_forge_request_update_missing_field - AssertionError: Traceback (most recent call last):
FAILED swh/web/tests/api/views/test_add_forge_now.py::test_add_forge_request_update - AssertionError: Traceback (most recent call last):
FAILED swh/web/tests/api/views/test_add_forge_now.py::test_add_forge_request_update_invalid_new_status - AssertionError: Traceback (most recent call last):
FAILED swh/web/tests/api/views/test_add_forge_now.py::test_add_forge_request_update_status_concurrent - AssertionError: Traceback (most recent call last):
FAILED swh/web/tests/api/views/test_add_forge_now.py::test_add_forge_request_list_anonymous - AssertionError: Traceback (most recent call last):
FAILED swh/web/tests/api/views/test_add_forge_now.py::test_add_forge_request_list_moderator - AssertionError: Traceback (most recent call last):
FAILED swh/web/tests/api/views/test_add_forge_now.py::test_add_forge_request_list_pagination - AssertionError: Traceback (most recent call last):
FAILED swh/web/tests/api/views/test_add_forge_now.py::test_add_forge_request_list_submitter_filtering - AssertionError: Traceback (most recent call last):
FAILED swh/web/tests/api/views/test_add_forge_now.py::test_add_forge_request_get - AssertionError: Traceback (most recent call last):
FAILED swh/web/tests/api/views/test_add_forge_now.py::test_add_forge_request_get_moderator - AssertionError: Traceback (most recent call last):
FAILED swh/web/tests/api/views/test_add_forge_now.py::test_add_forge_request_get_invalid - AssertionError: Traceback (most recent call last):
================================================================================================== 19 failed, 4 passed, 12 warnings in 8.77s ==================================================================================================

This does not make any sense to me since it's an implementation detail which should end up being the same thing...
And i'm really annoyed with this so i'll keep this as is if you don't mind.

I've opened the other diff which should be equivalent D7452 so what i just said makes more sense to you.

Build was aborted

Patch application report for D7446 (id=26968)

Could not rebase; Attempt merge onto 4bc8aaf1d9...

Updating 4bc8aaf1..c5825f74
Fast-forward
 swh/web/add_forge_now/apps.py                          |  4 +++-
 .../migrations/0004_auto_20220329_0844.py              | 15 +++++++++++++++
 swh/web/add_forge_now/models.py                        | 18 ++++++++++++++++--
 swh/web/inbound_email/management/__init__.py           |  0
 swh/web/inbound_email/management/commands/__init__.py  |  0
 5 files changed, 34 insertions(+), 3 deletions(-)
 create mode 100644 swh/web/add_forge_now/migrations/0004_auto_20220329_0844.py
 create mode 100644 swh/web/inbound_email/management/__init__.py
 create mode 100644 swh/web/inbound_email/management/commands/__init__.py
Changes applied before test
commit c5825f7487c87f87c3ae965bcb38b0a8cd738bba
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Tue Mar 29 09:25:24 2022 +0200

    Install app_label on add_forge_now model classes
    
    This should alleviate problems in documentation build.
    
    This triggers a necessary noop migration otherwise django tools are not happy.

commit 0c1e63d70261d917be5f4c3400772c6864e6cb56
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Tue Mar 29 09:50:12 2022 +0200

    swh.web.inbound_email: Add missing __init__.py file
    
    My hypothesis is that those missing files are making the swh-docs build fail.
    That's the only difference i see between those swh.web folders and the rest.

Link to build: https://jenkins.softwareheritage.org/job/DWAPPS/job/tests-on-diff/1617/
See console output for more information: https://jenkins.softwareheritage.org/job/DWAPPS/job/tests-on-diff/1617/console

Build has FAILED

Patch application report for D7446 (id=27010)

Rebasing onto f8e4ad3a51...

Current branch diff-target is up to date.
Changes applied before test
commit b347b3f431406a73ec62c43ff9e8f1850f4b9cfb
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Tue Mar 29 09:25:24 2022 +0200

    Install app_label on add_forge_now model classes
    
    This should alleviate problems in documentation build.
    
    This triggers a necessary noop migration otherwise django tools are not happy.

Link to build: https://jenkins.softwareheritage.org/job/DWAPPS/job/tests-on-diff/1625/
See console output for more information: https://jenkins.softwareheritage.org/job/DWAPPS/job/tests-on-diff/1625/console

Harbormaster returned this revision to the author for changes because remote builds failed.Mar 29 2022, 4:02 PM
Harbormaster failed remote builds in B27926: Diff 27010!

Fix also app_label name in migration tests.

Build was aborted

Patch application report for D7446 (id=27021)

Rebasing onto f8e4ad3a51...

Current branch diff-target is up to date.
Changes applied before test
commit 6e1b49e4344842d4a6d3fadedf57aa050a3dc901
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Tue Mar 29 09:25:24 2022 +0200

    Install app_label on add_forge_now model classes
    
    This should alleviate problems in documentation build.
    
    Also, it turns out the add_forge_now apps was misconfigured. This commit fixes that.

Link to build: https://jenkins.softwareheritage.org/job/DWAPPS/job/tests-on-diff/1632/
See console output for more information: https://jenkins.softwareheritage.org/job/DWAPPS/job/tests-on-diff/1632/console

Harbormaster returned this revision to the author for changes because remote builds failed.Mar 29 2022, 5:06 PM
Harbormaster failed remote builds in B27937: Diff 27021!

Build was aborted

Patch application report for D7446 (id=27027)

Rebasing onto f8e4ad3a51...

Current branch diff-target is up to date.
Changes applied before test
commit 6e1b49e4344842d4a6d3fadedf57aa050a3dc901
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Tue Mar 29 09:25:24 2022 +0200

    Install app_label on add_forge_now model classes
    
    This should alleviate problems in documentation build.
    
    Also, it turns out the add_forge_now apps was misconfigured. This commit fixes that.

Link to build: https://jenkins.softwareheritage.org/job/DWAPPS/job/tests-on-diff/1634/
See console output for more information: https://jenkins.softwareheritage.org/job/DWAPPS/job/tests-on-diff/1634/console

Harbormaster returned this revision to the author for changes because remote builds failed.Mar 29 2022, 5:31 PM
Harbormaster failed remote builds in B27943: Diff 27027!

Rebase and finally unstuck the cypress tests (after some heavy breathing [1])

[1] P1321

Build is green

Patch application report for D7446 (id=27057)

Rebasing onto f82d436fad...

Current branch diff-target is up to date.
Changes applied before test
commit 0dc0765eed2e6213eb8cd9e015b3593d887aed87
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Tue Mar 29 09:25:24 2022 +0200

    Install app_label on add_forge_now model classes
    
    This should alleviate problems in documentation build.
    
    Also, it turns out the add_forge_now apps was misconfigured. This commit fixes that.

See https://jenkins.softwareheritage.org/job/DWAPPS/job/tests-on-diff/1636/ for more details.

This revision is now accepted and ready to land.Mar 29 2022, 6:22 PM