Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Refactoring SCMWebhook away #15956

Open
wants to merge 66 commits into
base: master
Choose a base branch
from

Conversation

hennevogel
Copy link
Member

No description provided.

@github-actions github-actions bot added the Frontend Things related to the OBS RoR app label Apr 10, 2024
@hennevogel hennevogel marked this pull request as draft April 10, 2024 10:17
@hennevogel hennevogel force-pushed the refactoring/scm_webhook branch 2 times, most recently from b848e29 to d9d43cb Compare April 10, 2024 13:57
@krauselukas krauselukas force-pushed the refactoring/scm_webhook branch 4 times, most recently from 167b33c to 0d9c7ab Compare April 11, 2024 12:59
@hennevogel
Copy link
Member Author

@krauselukas krauselukas force-pushed the refactoring/scm_webhook branch 2 times, most recently from ce4dfbb to 940a867 Compare April 12, 2024 12:47
@hennevogel hennevogel force-pushed the refactoring/scm_webhook branch 5 times, most recently from 1737385 to 70217b1 Compare April 12, 2024 14:56
@eduardoj
Copy link
Member

Typo in one of the commits title: "Regernerate database_consistency todo" should be "Regenerate database_consistency todo"

krauselukas and others added 22 commits July 1, 2024 16:46
…thod

We have to pass it a `WorkflowRun` object, otherwise its failing...
Adapt Workflow::Step#target_package_name to avoid duplication and remove
the implementation in Workflow::Step::SetFlags.
We have to make sure the attributes are set before the validation
happens to catch eventual errors. We also have to make sure that
the attributes are only set from the request payload if they havent
been set explicitly when creating the record.
We can simply handle the active record exceptions and render the
appropriate error. Also, we can authorize first the token, there is no
need to even initialize a workflow run if a user is not permitted to run
a workflow.

Also get rid of the create_workflow_run method. The workflow creation is
moved to the 'create' method but the request_headers extraction is moved
to a specific method (to not increase complexity).
These migrations and specs need adaptation that is not worth it.
The data migrations were applied to production long ago. It's safe to
remove it now.

- BackfillScmVendorAndHookEventInWorkflowRun. Workflow run has a new validation that doesn't allow to create it
without scm_vendor.
- RemoveUnsupportedHookEvents. The constants are moved to another model.
Thats what the TAR SCM service expects, there are not other types
that are supported....
Now the ReportToSCMJob needs to have the workflow run set.
@krauselukas krauselukas marked this pull request as ready for review July 1, 2024 14:59
@krauselukas krauselukas changed the title Refactoring SCMWebhook away WIP: Refactoring SCMWebhook away Jul 1, 2024
Those values are now defined in workflow_run, so we need to set the
workflow run in all the specs too.
commit_sha: @event_subscription_payload[:commit_sha],
api_endpoint: @workflow_run.api_endpoint,
target_repository_full_name: @workflow_run.target_repository_full_name,
commit_sha: @workflow_run[:commit_sha],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be @workflow_run.commit_sha

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Frontend Things related to the OBS RoR app
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants