Page MenuHomeSoftware Heritage

admin: Add mailmaps administration Web UI
ClosedPublic

Authored by anlambert on Mar 18 2022, 5:51 PM.

Details

Summary

Add a new administration view to manage the mailmaps in the
archive.

The view allows to add new mailmaps or update existing ones.

It requires a special user permission swh.web.admin.mailmap
to be used.

Only mailmaps created by users with that permission will be
displayed in that view.



Diff Detail

Repository
rDWAPPS Web applications
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

Build is green

Patch application report for D7396 (id=26726)

Rebasing onto dfccbcf9bd...

Current branch diff-target is up to date.
Changes applied before test
commit 9013bc94cbe8a4c7bdd58a19e1dacffba53b2745
Author: Antoine Lambert <anlambert@softwareheritage.org>
Date:   Thu Feb 3 13:49:19 2022 +0100

    admin: Add mailmaps administration Web UI
    
    Add a new administration view to manage the mailmaps in the
    archive.
    
    The view allows to add new mailmaps or update existing ones.
    
    It requires a special user permission "swh.web.admin.mailmap"
    to be used.
    
    Only mailmaps created by users with that permission will be
    displayed in that view.

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

Update:

  • rebase
  • fix issues in datatables endpoint implementation
  • add missing tests for better coverage

Build has FAILED

Patch application report for D7396 (id=26742)

Rebasing onto f232481f96...

Current branch diff-target is up to date.
Changes applied before test
commit 3d7f2250ab249370ab8055f4cdd3ed265cef4ac3
Author: Antoine Lambert <anlambert@softwareheritage.org>
Date:   Thu Feb 3 13:49:19 2022 +0100

    admin: Add mailmaps administration Web UI
    
    Add a new administration view to manage the mailmaps in the
    archive.
    
    The view allows to add new mailmaps or update existing ones.
    
    It requires a special user permission "swh.web.admin.mailmap"
    to be used.
    
    Only mailmaps created by users with that permission will be
    displayed in that view.

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

Build is green

Patch application report for D7396 (id=26742)

Rebasing onto 82d7c4bd39...

First, rewinding head to replay your work on top of it...
Applying: admin: Add mailmaps administration Web UI
Changes applied before test
commit c7be089336a9b7ba866a6a35dbc2a90d87b9c716
Author: Antoine Lambert <anlambert@softwareheritage.org>
Date:   Thu Feb 3 13:49:19 2022 +0100

    admin: Add mailmaps administration Web UI
    
    Add a new administration view to manage the mailmaps in the
    archive.
    
    The view allows to add new mailmaps or update existing ones.
    
    It requires a special user permission "swh.web.admin.mailmap"
    to be used.
    
    Only mailmaps created by users with that permission will be
    displayed in that view.

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

vlorentz added inline comments.
assets/src/bundles/admin/mailmap-form.ejs
16

To make it clear this expects name + email

assets/src/bundles/admin/mailmap.js
144

that's clearer IMO

swh/web/auth/mailmap.py
66

If admin-created mailmaps have a NULL user_id, then we need a DB migration.

swh/web/templates/admin/mailmap.html
43

hmm, I don't know if "effective" is clear enough for users; but I don't have a better suggestion

assets/src/bundles/admin/mailmap-form.ejs
16

Good idea.

assets/src/bundles/admin/mailmap.js
144

ack

swh/web/auth/mailmap.py
66

No we are good here, this is already handled by the UserMailmap model.

swh/web/templates/admin/mailmap.html
43

Applied ?

Rebase and address some @vlorentz comments

swh/web/auth/mailmap.py
66

I mean that mailmap entries I already created as admin are not NULL.

swh/web/auth/mailmap.py
66

Ok, got it.

Build was aborted

Patch application report for D7396 (id=26770)

Rebasing onto ac5e79103c...

Current branch diff-target is up to date.
Changes applied before test
commit 4b6f0654969a983a03d63a78445ee600cbb8c7ba
Author: Antoine Lambert <anlambert@softwareheritage.org>
Date:   Thu Feb 3 13:49:19 2022 +0100

    admin: Add mailmaps administration Web UI
    
    Add a new administration view to manage the mailmaps in the
    archive.
    
    The view allows to add new mailmaps or update existing ones.
    
    It requires a special user permission "swh.web.admin.mailmap"
    to be used.
    
    Only mailmaps created by users with that permission will be
    displayed in that view.

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

Rebase and add new database migration changing user_id of existing mailmaps in production to None to indicate they have been created by an administrator.

Build has FAILED

Patch application report for D7396 (id=26790)

Rebasing onto d6605c7a7e...

Current branch diff-target is up to date.
Changes applied before test
commit 0b804f1dc9258799f961e616b66d233c982e13e5
Author: Antoine Lambert <anlambert@softwareheritage.org>
Date:   Thu Feb 3 13:49:19 2022 +0100

    admin: Add mailmaps administration Web UI
    
    Add a new administration view to manage the mailmaps in the
    archive.
    
    The view allows to add new mailmaps or update existing ones.
    
    It requires a special user permission "swh.web.admin.mailmap"
    to be used.
    
    Only mailmaps created by users with that permission will be
    displayed in that view.

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

Build is green

Patch application report for D7396 (id=26832)

Rebasing onto 6f0cc70fdd...

Current branch diff-target is up to date.
Changes applied before test
commit fe137e22529f9e1d51957209120f0eb0ad01ff40
Author: Antoine Lambert <anlambert@softwareheritage.org>
Date:   Thu Feb 3 13:49:19 2022 +0100

    admin: Add mailmaps administration Web UI
    
    Add a new administration view to manage the mailmaps in the
    archive.
    
    The view allows to add new mailmaps or update existing ones.
    
    It requires a special user permission "swh.web.admin.mailmap"
    to be used.
    
    Only mailmaps created by users with that permission will be
    displayed in that view.

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

This revision is now accepted and ready to land.Mar 24 2022, 10:20 AM