Page MenuHomeSoftware Heritage

misc/badges: Move feature into a dedicated django application
ClosedPublic

Authored by anlambert on Aug 23 2022, 4:51 PM.

Details

Summary

It only depends on swh.web.browse which is a base django application
always activated so it can be moved into its own django application.

Diff Detail

Repository
rDWAPPS Web applications
Branch
django-apps-refactoring-badges
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 31016
Build 48516: Phabricator diff pipeline on jenkinsJenkins console · Jenkins
Build 48515: arc lint + arc unit

Unit TestsFailed

TimeTest
24,552 msJenkins > should display badge integration info when clicking on it::Tests / Cypress tests / Run cypress tests / Persistent Identifiers Tests should display badge integration info when clicking on it
AssertionError: Timed out retrying after 20000ms: expected '<code.swh-badge-html.html.hljs.language-xml>' to contain text 'http://localhost:5004/swh:1:cnt:b2613ff021265c651e06a8ce3845bf03d033172d;origin=https://github.com/wcoder/highlightjs-line-numbers.js;visit=swh:1:snp:da8abf3ec5203afa1561754a041aca64d7580ec2;anchor=swh:1:rel:6877028d6e5412780517d0bfa81f07f6c51abb41;path=/src/highlightjs-line-numbers.js;lines=6-12', but the text was '<a href="http://localhost:5004/">\n <img src="http://localhost:5004/badge//">\n</a>' at Context.eval (http://localhost:5004/__cypress/tests?p=cypress/e2e/persistent-identifiers.cy.js:233:50)
208 msJenkins > .tox.py3.lib.python3.7.site-packages.swh.web.tests.add_forge_now.test_api_views::Tests / Python tests / test_add_forge_request_create_anonymous_user
319 msJenkins > .tox.py3.lib.python3.7.site-packages.swh.web.tests.add_forge_now.test_api_views::Tests / Python tests / test_add_forge_request_create_duplicate
231 msJenkins > .tox.py3.lib.python3.7.site-packages.swh.web.tests.add_forge_now.test_api_views::Tests / Python tests / test_add_forge_request_create_empty
321 msJenkins > .tox.py3.lib.python3.7.site-packages.swh.web.tests.add_forge_now.test_api_views::Tests / Python tests / test_add_forge_request_create_invalid_forge_url
View Full Test Results (1 Failed · 1,024 Passed · 2 Skipped)

Event Timeline

Build was aborted

Patch application report for D8297 (id=29958)

Rebasing onto 007c9c782d...

Current branch diff-target is up to date.
Changes applied before test
commit 5a86b2fb0fafba99908e2e0b2c96f53959273f26
Author: Antoine Lambert <anlambert@softwareheritage.org>
Date:   Tue Aug 23 16:46:47 2022 +0200

    misc/badges: Move feature into a dedicated django application
    
    It only depends on swh.web.browse which is a base django application
    always activated so it can be moved into its own django application.

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

Harbormaster returned this revision to the author for changes because remote builds failed.Aug 23 2022, 5:24 PM
Harbormaster failed remote builds in B31009: Diff 29958!
Harbormaster returned this revision to the author for changes because remote builds failed.Aug 23 2022, 7:05 PM
Harbormaster failed remote builds in B31016: Diff 29965!

Build has FAILED

Patch application report for D8297 (id=29965)

Rebasing onto 8496d6a551...

Current branch diff-target is up to date.
Changes applied before test
commit 074c55efb8eca262f79203c53f6b20935a92df06
Author: Antoine Lambert <anlambert@softwareheritage.org>
Date:   Tue Aug 23 16:46:47 2022 +0200

    misc/badges: Move feature into a dedicated django application
    
    It only depends on swh.web.browse which is a base django application
    always activated so it can be moved into its own django application.

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

Rebase and fix cypress test

Build is green

Patch application report for D8297 (id=29985)

Rebasing onto ddcfa6ce48...

Current branch diff-target is up to date.
Changes applied before test
commit c24f1a764af63a5fbb6abbfc8b66e100cc1e6f20
Author: Antoine Lambert <anlambert@softwareheritage.org>
Date:   Tue Aug 23 16:46:47 2022 +0200

    misc/badges: Move feature into a dedicated django application
    
    It only depends on swh.web.browse which is a base django application
    always activated so it can be moved into its own django application.

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

jayeshv added inline comments.
swh/web/browse/templates/includes/show-swhids.html
65

This check is to enable and disable support for badges, correct?. Will the /badge/<swhid> URL throw a 404 if the app is missing?

swh/web/browse/templates/includes/show-swhids.html
65

Yes of course, see test_badges_deactivate below.

This revision is now accepted and ready to land.Aug 24 2022, 3:15 PM