Skip to content
This repository has been archived by the owner on Jul 23, 2024. It is now read-only.

Check if generated files are up-to-date #164

Merged
merged 1 commit into from
Mar 27, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ jobs:
- name: Maven Build
run: mvn clean spring-javaformat:validate package

- name: Check generated files are up to date
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can be that the API is changed and the open API is not updated?
Are we creating the open API when we build?
Are we updating the auto-generation of the SDK on package?

Sorry, too many questions but maven things are pretty new to me 😅

Copy link
Contributor Author

@gciavarrini gciavarrini Mar 24, 2023

Choose a reason for hiding this comment

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

Legit questions!

Can be that the API is changed and the open API is not updated?

no, because (see next answer :) )

Are we creating the open API when we build?

yes!

Are we updating the auto-generation of the SDK on package?

yes

To recap: at the moment during every package phase, the generator first creates the openapi.json file from the spring beans, then it generates the SDK source code and the jar.

In future PR, I'll move the generation to a following phase (maybe verify) to let developer work on their changes without having to deal with all the generated files. Then, the CI will verify if the outcome of mvn verify has uncommited changes.

run: |
if [[ $(git ls-files --others --exclude-standard) ]]; then echo "These files are not tracked by git"; git ls-files --others --exclude-standard; exit 1; fi
if [ -n "$(git status --porcelain)" ]; then echo "There are uncommitted changes:"; git status --short; exit 1; fi

- name: "Build container images"
run: |
make build-images GIT_BRANCH=${GITHUB_REF##*/}
Expand Down