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

Ignore _merged_spec.yaml when computing build cache key #18105

Merged

Conversation

jprinet
Copy link
Contributor

@jprinet jprinet commented Mar 14, 2024

Issue

The build has some cache misses when run twice without any change (on a fresh clone). The cost here is 10s of wall clock time:
Screenshot 2024-03-14 at 3 25 55 PM

The problem is that the file modules/openapi-generator-maven-plugin/src/test/resources/default/_merged_spec.yaml generated by the maven-plugin module tests is located in the src/test/resources folder which is used as goal input by compiler:testCompile and surefire:test from the maven-plugin module.

Screenshot 2024-03-14 at 3 22 45 PM

This means that the cache key is different, therefore the cache misses.

Steps to reproduce

Clone the project in a new location

git clone [email protected]:OpenAPITools/openapi-generator.git /tmp/openapi-generator
cd /tmp/openapi-generator
./mvnw clean package
./mvnw clean package

Fix

The best solution would be to generate the _merged_spec.yaml in the target directory, however I couldn't find a way to configure this.
The approach taken is to ignore the file while computing the cache key with help of RuntimeNormalization.

PR checklist

  • Read the contribution guidelines.
  • Pull Request title clearly describes the work in the pull request and Pull Request description provides details about how to validate the work. Missing information here may result in delayed response from the community.
  • Run the following to build the project and update samples:
    ./mvnw clean package 
    ./bin/generate-samples.sh ./bin/configs/*.yaml
    ./bin/utils/export_docs_generators.sh
    
  • File the PR against the correct branch: master (upcoming 7.1.0 minor release - breaking changes with fallbacks), 8.0.x (breaking changes without fallbacks)
  • If your PR is targeting a particular programming language, @mention the technical committee members, so they are more likely to review the pull request.

@wing328 wing328 merged commit 3bd8974 into OpenAPITools:master Mar 15, 2024
15 checks passed
zapodot pushed a commit to zapodot/openapi-generator that referenced this pull request Mar 21, 2024
@wing328 wing328 added this to the 7.5.0 milestone Apr 17, 2024
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