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

Schedule individual CreateOnGithubJobs for each CommitDeploymentStatus that needs to be created #1342

Closed

Conversation

kwboyd-shopify
Copy link
Contributor

Similar to #1341.

CreateOnGithubJob also can run for a long time. This breaks it up so that when it's called on a CommitDeployment, we schedule individual jobs to create each of that deployment's statuses on GitHub instead of doing all of that within the initial CreateOnGithubJob that was called on the CommitDeployment.

@kwboyd-shopify kwboyd-shopify requested a review from a team April 12, 2024 18:00
@kwboyd-shopify kwboyd-shopify self-assigned this Apr 12, 2024
@@ -10,7 +10,7 @@ class CommitDeployment < Record

def create_on_github!
create_deployment_on_github!
statuses.order(id: :asc).each(&:create_on_github!)
statuses.order(id: :asc).each { |status| CreateOnGithubJob.perform_later(status) }
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't remember for sure, but I think the id: :asc was here because the last status is what is important, so creation order is just as important.

So if you queue a job for each, the order now is random, which I'm pretty sure is a bug.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah, that makes sense, thanks for catching that. I'm going to close this for now since this seemed like an easy enhancement but would actually be more complex than I thought. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants