Skip to content
This repository was archived by the owner on Jul 13, 2025. It is now read-only.

Python: use 'ProtoFiles.getProtoFiles' to sort enums by filename.#2418

Merged
tseaver merged 2 commits intogoogleapis:masterfrom
tseaver:2319-python-stable_enum_order
Nov 9, 2018
Merged

Python: use 'ProtoFiles.getProtoFiles' to sort enums by filename.#2418
tseaver merged 2 commits intogoogleapis:masterfrom
tseaver:2319-python-stable_enum_order

Conversation

@tseaver
Copy link
Copy Markdown
Contributor

@tseaver tseaver commented Nov 9, 2018

Closes #2319.

I hope. :)

@tseaver tseaver added lang: python Issues specific to Python. yoshi labels Nov 9, 2018
@tseaver tseaver requested a review from andreamlin November 9, 2018 18:30
@tseaver tseaver changed the title Python: use 'ProtoFiles.getProtoFiles' to sort enums by filenam. Python: use 'ProtoFiles.getProtoFiles' to sort enums by filename. Nov 9, 2018
@codecov-io
Copy link
Copy Markdown

codecov-io commented Nov 9, 2018

Codecov Report

Merging #2418 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #2418      +/-   ##
============================================
+ Coverage     86.72%   86.72%   +<.01%     
- Complexity     5242     5243       +1     
============================================
  Files           458      458              
  Lines         20880    20881       +1     
  Branches       2252     2252              
============================================
+ Hits          18109    18110       +1     
  Misses         1968     1968              
  Partials        803      803
Impacted Files Coverage Δ Complexity Δ
.../transformer/py/PythonGapicSurfaceTransformer.java 98.3% <100%> (ø) 44 <1> (+1) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ef8cdcd...1bd1757. Read the comment docs.

@andreamlin
Copy link
Copy Markdown
Contributor

Are there any baseline changes, or are there any changes in the existing generated clients once this goes in?

@tseaver
Copy link
Copy Markdown
Contributor Author

tseaver commented Nov 9, 2018

@andreamlin The baselines didn't change. I believe that the unstable ordering might be related to reading files from the filesystem in "directory order," which isn't necessarily sorted over time. So, this PR just tries to guarantee that the list of proto files is always sorted when generating enums.py.

We do see spurious enum changes showing up due to #2319, e.g. today:

Copy link
Copy Markdown
Contributor

@andreamlin andreamlin left a comment

Choose a reason for hiding this comment

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

LGTM

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

lang: python Issues specific to Python. yoshi

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants