Skip to content

Make gazelle_python_manifest output deterministic #813

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

Merged
merged 3 commits into from
Aug 30, 2022
Merged

Make gazelle_python_manifest output deterministic #813

merged 3 commits into from
Aug 30, 2022

Conversation

abhishekshivanna
Copy link
Contributor

When invoking the update rule on gazelle_python_manifest
the output generated to gazelle_python.yaml mapping file
is not deterministic.
This non-determinism causes the test rule for gazelle_python_manifest
to always fail.
This patch fixes the bug by sorting the keys before writing it to the
mapping file, making the output deterministic

Test Plan: Existing unit tests to verify the output

Fixes #812

PR Checklist

Please check if your PR fulfills the following requirements:

  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature (please, look at the "Scope of the project" section in the README.md file)
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • Other... Please describe:

What is the current behavior?

Issue Number: #812

What is the new behavior?

See commit summary

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

@google-cla
Copy link

google-cla bot commented Aug 28, 2022

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@f0rmiga
Copy link
Member

f0rmiga commented Aug 29, 2022

@abhishekshivanna thanks for the contribution!

@f0rmiga
Copy link
Member

f0rmiga commented Aug 30, 2022

@abhishekshivanna thanks for addressing my comments.

@f0rmiga f0rmiga merged commit 0dfc546 into bazel-contrib:main Aug 30, 2022
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.

Output generated by gazelle_python_manifest is not deterministic
2 participants