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

fail sooner when PR creation data is incomplete #9888

Merged
merged 2 commits into from
Jun 3, 2024
Merged

Conversation

jakecoffman
Copy link
Member

@jakecoffman jakecoffman commented Jun 3, 2024

What are you trying to accomplish?

The PullRequestCreator refuses to create PRs when either the previous_version is absent or the previous_requirements reveal there were no changes to a dependency.

That code is here:

sig { void }
def check_dependencies_have_previous_version
return if dependencies.all? { |d| requirements_changed?(d) }
return if dependencies.all?(&:previous_version)
raise "Dependencies must have a previous version or changed " \
"requirement to have a pull request created for them!"
end

This results in what looks like successful runs ending with a PR not being created.

To improve this, we need to move the validation check closer to where the issue is. In this PR, I added behind an experiment the same check right before sending the PR data to the client.

This will give us, and customers, more information about the nature of the problem, since it will tell us which dependency is failing and why. Then we can target which ecosystems need help and see if we can fix them.

How will you know you've accomplished your goal?

We should start seeing the errors from the Updater side and track them in Sentry along with the dependency name and ecosystem.

Checklist

  • I have run the complete test suite to ensure all tests and linters pass.
  • I have thoroughly tested my code changes to ensure they work as expected, including adding additional tests for new functionality.
  • I have written clear and descriptive commit messages.
  • I have provided a detailed description of the changes in the pull request, including the problem it addresses, how it fixes the problem, and any relevant details about the implementation.
  • I have ensured that the code is well-documented and easy to understand.

@jakecoffman jakecoffman requested a review from a team as a code owner June 3, 2024 17:47
@jakecoffman jakecoffman merged commit 1dab6f5 into main Jun 3, 2024
121 checks passed
@jakecoffman jakecoffman deleted the fail-sooner branch June 3, 2024 20:03
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.

2 participants