Page MenuHomeSoftware Heritage

save_code_now: Indicate if request was created from webhook in Web UI
ClosedPublic

Authored by anlambert on Nov 29 2022, 5:00 PM.

Details

Summary

In the save code now requests table, add a webhook icon in the Info column
indicating if a request was created from a popular forge webhook receiver.

Related to T4548

Depends on D8890

Diff Detail

Repository
rDWAPPS Web applications
Branch
save-code-now-ui-webhook-icon
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 33055
Build 51810: Phabricator diff pipeline on jenkinsJenkins console · Jenkins
Build 51809: arc lint + arc unit

Event Timeline

Build has FAILED

Patch application report for D8902 (id=32082)

Could not rebase; Attempt merge onto d9ffdd1759...

Updating d9ffdd17..470578dc
Fast-forward
 cypress/e2e/origin-save.cy.js                      | 40 +++++++++++++++++--
 swh/web/api/apidoc.py                              |  1 +
 swh/web/metrics/prometheus.py                      | 23 +++++++++++
 swh/web/metrics/tests/test_app.py                  |  2 +-
 swh/web/metrics/tests/test_metrics.py              | 27 ++++++++++++-
 swh/web/save_code_now/api_views.py                 | 45 +++++++++++++++++++---
 swh/web/save_code_now/assets/origin-save-admin.js  | 10 +++--
 swh/web/save_code_now/assets/origin-save.js        | 11 ++++--
 .../0013_saveoriginrequest_webhook_info.py         | 26 +++++++++++++
 swh/web/save_code_now/models.py                    |  4 ++
 swh/web/save_code_now/origin_save.py               | 10 +++++
 swh/web/save_code_now/tests/test_migrations.py     | 21 +++++++++-
 swh/web/save_code_now/tests/test_origin_save.py    |  2 +
 .../save_code_now/tests/test_origin_save_api.py    |  4 ++
 swh/web/save_origin_webhooks/generic_receiver.py   |  9 ++++-
 swh/web/save_origin_webhooks/tests/utils.py        |  6 +++
 swh/web/utils/typing.py                            |  4 ++
 17 files changed, 224 insertions(+), 21 deletions(-)
 create mode 100644 swh/web/save_code_now/migrations/0013_saveoriginrequest_webhook_info.py
Changes applied before test
commit 470578dcadb2b61770f252196ce45b31cfb8992a
Author: Antoine Lambert <anlambert@softwareheritage.org>
Date:   Tue Nov 29 16:55:07 2022 +0100

    save_code_now: Indicate if request was created from webhook in Web UI
    
    In the save code now requests table, add a webhook icon in the Info column
    indicating if a request was created from a popular forge webhook receiver.
    
    Related to T4548

commit 581e782b29fd0df5afd9316b96e691a5232d6067
Author: Antoine Lambert <anlambert@softwareheritage.org>
Date:   Tue Nov 29 15:00:09 2022 +0100

    metrics/tests/test_app: Fix test name

commit 50ad6e9f97344aee8826bc96cd2ff6507c76e41e
Author: Antoine Lambert <anlambert@softwareheritage.org>
Date:   Mon Nov 28 14:32:22 2022 +0100

    metrics: Add gauge counting save origin requests created from webhooks
    
    It enables to have some statistics in grafana about the number of save code
    now requests created from forge webhook receivers.
    
    Related to T4548

commit fb878e1a2cb5c041b1d3250701c273915fa3a2b6
Author: Antoine Lambert <anlambert@softwareheritage.org>
Date:   Mon Nov 28 14:07:22 2022 +0100

    save_code_now: Add webhook info fields to SaveOriginRequest model
    
    It enables to distinguish which requests were created from a forge
    webhook receiver and which forge type sent the webhook.
    
    Related to T4548

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

Harbormaster returned this revision to the author for changes because remote builds failed.Nov 29 2022, 5:19 PM
Harbormaster failed remote builds in B33033: Diff 32082!

Build was aborted

Patch application report for D8902 (id=32082)

Could not rebase; Attempt merge onto d9ffdd1759...

Updating d9ffdd17..470578dc
Fast-forward
 cypress/e2e/origin-save.cy.js                      | 40 +++++++++++++++++--
 swh/web/api/apidoc.py                              |  1 +
 swh/web/metrics/prometheus.py                      | 23 +++++++++++
 swh/web/metrics/tests/test_app.py                  |  2 +-
 swh/web/metrics/tests/test_metrics.py              | 27 ++++++++++++-
 swh/web/save_code_now/api_views.py                 | 45 +++++++++++++++++++---
 swh/web/save_code_now/assets/origin-save-admin.js  | 10 +++--
 swh/web/save_code_now/assets/origin-save.js        | 11 ++++--
 .../0013_saveoriginrequest_webhook_info.py         | 26 +++++++++++++
 swh/web/save_code_now/models.py                    |  4 ++
 swh/web/save_code_now/origin_save.py               | 10 +++++
 swh/web/save_code_now/tests/test_migrations.py     | 21 +++++++++-
 swh/web/save_code_now/tests/test_origin_save.py    |  2 +
 .../save_code_now/tests/test_origin_save_api.py    |  4 ++
 swh/web/save_origin_webhooks/generic_receiver.py   |  9 ++++-
 swh/web/save_origin_webhooks/tests/utils.py        |  6 +++
 swh/web/utils/typing.py                            |  4 ++
 17 files changed, 224 insertions(+), 21 deletions(-)
 create mode 100644 swh/web/save_code_now/migrations/0013_saveoriginrequest_webhook_info.py
Changes applied before test
commit 470578dcadb2b61770f252196ce45b31cfb8992a
Author: Antoine Lambert <anlambert@softwareheritage.org>
Date:   Tue Nov 29 16:55:07 2022 +0100

    save_code_now: Indicate if request was created from webhook in Web UI
    
    In the save code now requests table, add a webhook icon in the Info column
    indicating if a request was created from a popular forge webhook receiver.
    
    Related to T4548

commit 581e782b29fd0df5afd9316b96e691a5232d6067
Author: Antoine Lambert <anlambert@softwareheritage.org>
Date:   Tue Nov 29 15:00:09 2022 +0100

    metrics/tests/test_app: Fix test name

commit 50ad6e9f97344aee8826bc96cd2ff6507c76e41e
Author: Antoine Lambert <anlambert@softwareheritage.org>
Date:   Mon Nov 28 14:32:22 2022 +0100

    metrics: Add gauge counting save origin requests created from webhooks
    
    It enables to have some statistics in grafana about the number of save code
    now requests created from forge webhook receivers.
    
    Related to T4548

commit fb878e1a2cb5c041b1d3250701c273915fa3a2b6
Author: Antoine Lambert <anlambert@softwareheritage.org>
Date:   Mon Nov 28 14:07:22 2022 +0100

    save_code_now: Add webhook info fields to SaveOriginRequest model
    
    It enables to distinguish which requests were created from a forge
    webhook receiver and which forge type sent the webhook.
    
    Related to T4548

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

Build is green

Patch application report for D8902 (id=32082)

Could not rebase; Attempt merge onto d9ffdd1759...

Updating d9ffdd17..470578dc
Fast-forward
 cypress/e2e/origin-save.cy.js                      | 40 +++++++++++++++++--
 swh/web/api/apidoc.py                              |  1 +
 swh/web/metrics/prometheus.py                      | 23 +++++++++++
 swh/web/metrics/tests/test_app.py                  |  2 +-
 swh/web/metrics/tests/test_metrics.py              | 27 ++++++++++++-
 swh/web/save_code_now/api_views.py                 | 45 +++++++++++++++++++---
 swh/web/save_code_now/assets/origin-save-admin.js  | 10 +++--
 swh/web/save_code_now/assets/origin-save.js        | 11 ++++--
 .../0013_saveoriginrequest_webhook_info.py         | 26 +++++++++++++
 swh/web/save_code_now/models.py                    |  4 ++
 swh/web/save_code_now/origin_save.py               | 10 +++++
 swh/web/save_code_now/tests/test_migrations.py     | 21 +++++++++-
 swh/web/save_code_now/tests/test_origin_save.py    |  2 +
 .../save_code_now/tests/test_origin_save_api.py    |  4 ++
 swh/web/save_origin_webhooks/generic_receiver.py   |  9 ++++-
 swh/web/save_origin_webhooks/tests/utils.py        |  6 +++
 swh/web/utils/typing.py                            |  4 ++
 17 files changed, 224 insertions(+), 21 deletions(-)
 create mode 100644 swh/web/save_code_now/migrations/0013_saveoriginrequest_webhook_info.py
Changes applied before test
commit 470578dcadb2b61770f252196ce45b31cfb8992a
Author: Antoine Lambert <anlambert@softwareheritage.org>
Date:   Tue Nov 29 16:55:07 2022 +0100

    save_code_now: Indicate if request was created from webhook in Web UI
    
    In the save code now requests table, add a webhook icon in the Info column
    indicating if a request was created from a popular forge webhook receiver.
    
    Related to T4548

commit 581e782b29fd0df5afd9316b96e691a5232d6067
Author: Antoine Lambert <anlambert@softwareheritage.org>
Date:   Tue Nov 29 15:00:09 2022 +0100

    metrics/tests/test_app: Fix test name

commit 50ad6e9f97344aee8826bc96cd2ff6507c76e41e
Author: Antoine Lambert <anlambert@softwareheritage.org>
Date:   Mon Nov 28 14:32:22 2022 +0100

    metrics: Add gauge counting save origin requests created from webhooks
    
    It enables to have some statistics in grafana about the number of save code
    now requests created from forge webhook receivers.
    
    Related to T4548

commit fb878e1a2cb5c041b1d3250701c273915fa3a2b6
Author: Antoine Lambert <anlambert@softwareheritage.org>
Date:   Mon Nov 28 14:07:22 2022 +0100

    save_code_now: Add webhook info fields to SaveOriginRequest model
    
    It enables to distinguish which requests were created from a forge
    webhook receiver and which forge type sent the webhook.
    
    Related to T4548

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

This revision is now accepted and ready to land.Nov 30 2022, 9:44 AM

Build is green

Patch application report for D8902 (id=32103)

Could not rebase; Attempt merge onto d9ffdd1759...

Updating d9ffdd17..f392e87c
Fast-forward
 cypress/e2e/origin-save.cy.js                      | 40 ++++++++++++++++++---
 docs/uri-scheme-api-origin.rst                     | 14 ++++++++
 swh/web/api/apidoc.py                              |  1 +
 swh/web/metrics/prometheus.py                      | 23 ++++++++++++
 swh/web/metrics/tests/test_app.py                  |  2 +-
 swh/web/metrics/tests/test_metrics.py              | 27 ++++++++++++--
 swh/web/save_code_now/api_views.py                 | 42 ++++++++++++++++++----
 swh/web/save_code_now/assets/origin-save-admin.js  | 10 ++++--
 swh/web/save_code_now/assets/origin-save.js        | 11 ++++--
 .../0013_saveoriginrequest_webhook_info.py         | 26 ++++++++++++++
 swh/web/save_code_now/models.py                    |  4 +++
 swh/web/save_code_now/origin_save.py               | 10 ++++++
 swh/web/save_code_now/tests/test_migrations.py     | 21 ++++++++++-
 swh/web/save_code_now/tests/test_origin_save.py    |  2 ++
 .../save_code_now/tests/test_origin_save_api.py    |  4 +++
 swh/web/save_origin_webhooks/generic_receiver.py   |  9 ++++-
 swh/web/save_origin_webhooks/tests/utils.py        |  6 ++++
 swh/web/utils/typing.py                            |  4 +++
 18 files changed, 235 insertions(+), 21 deletions(-)
 create mode 100644 swh/web/save_code_now/migrations/0013_saveoriginrequest_webhook_info.py
Changes applied before test
commit f392e87cf449f98b9fa96364e365c2d40861b013
Author: Antoine Lambert <anlambert@softwareheritage.org>
Date:   Tue Nov 29 16:55:07 2022 +0100

    save_code_now: Indicate if request was created from webhook in Web UI
    
    In the save code now requests table, add a webhook icon in the Info column
    indicating if a request was created from a popular forge webhook receiver.
    
    Related to T4548

commit ce8da30b98426c47aba1f9c0feb0ff30d71ceb3a
Author: Antoine Lambert <anlambert@softwareheritage.org>
Date:   Tue Nov 29 15:00:09 2022 +0100

    metrics/tests/test_app: Fix test name

commit b4fc49b3fe92651f950a83705d5d952ec488ad8c
Author: Antoine Lambert <anlambert@softwareheritage.org>
Date:   Mon Nov 28 14:32:22 2022 +0100

    metrics: Add gauge counting save origin requests created from webhooks
    
    It enables to have some statistics in grafana about the number of save code
    now requests created from forge webhook receivers.
    
    Related to T4548

commit 12a291957fa06e3b6fde1ebd3a65cad8e3b03016
Author: Antoine Lambert <anlambert@softwareheritage.org>
Date:   Mon Nov 28 14:07:22 2022 +0100

    save_code_now: Add webhook info fields to SaveOriginRequest model
    
    It enables to distinguish which requests were created from a forge
    webhook receiver and which forge type sent the webhook.
    
    Related to T4548

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