opensearch-project / opensearch-py

Python Client for OpenSearch
https://opensearch.org/docs/latest/clients/python/
Apache License 2.0
359 stars 178 forks source link

Enhance generator to update changelog only if generated code differs from existing #684

Closed saimedhi closed 8 months ago

saimedhi commented 8 months ago

Description

Enhance generator to update changelog only if generated code differs from existing code.

Issues Resolved

https://github.com/opensearch-project/opensearch-py/pull/680#issuecomment-1966865315

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license. For more information on following Developer Certificate of Origin and signing off your commits, please check here.

codecov[bot] commented 8 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 72.14%. Comparing base (4b69c09) to head (ab8d612).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #684 +/- ## ======================================= Coverage 72.14% 72.14% ======================================= Files 89 89 Lines 7945 7945 ======================================= Hits 5732 5732 Misses 2213 2213 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

saimedhi commented 8 months ago

I'll merge, but this seems a little complicated.

Would it make things simpler to do the rm -rf, generate the code into opensearchpy, then look at git status to see what has changed?

I'll give that approach a try. Just want to make sure files like .pycache won't cause any issues.

dblock commented 8 months ago

I'll merge, but this seems a little complicated. Would it make things simpler to do the rm -rf, generate the code into opensearchpy, then look at git status to see what has changed?

I'll give that approach a try. Just want to make sure files like .pycache won't cause any issues.

Anything generated should be in .gitignore.

dblock commented 8 months ago

I'll give that approach a try.

Btw, I think it's not important what has changed. The workflow that runs this check could generate the code, then check whether anything has changed, and only if something has generate the changelog. Then try opening the PR which would do nothing if there were no changes.