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

chore(CI): add pipeline to check sidecar version against OpenAPI spec and client code versions #1062

Merged
merged 24 commits into from
Feb 21, 2025

Conversation

shouples
Copy link
Contributor

@shouples shouples commented Feb 21, 2025

Some cleanup to go along with confluentinc/ide-sidecar#332 to make sure our .versions/ide-sidecar.txt and OpenAPI spec version match, along with the code in the openapi-generator client code comments:

* The version of the OpenAPI document: 1.0.1

Failure cases:

.versions/ide-sidecar.txt doesn't match with the OpenAPI spec client code doesn't match the OpenAPI spec (and we need to run gulp apigen)
Terminal output image image
PR comment image image

@semaphore-agent-production
Copy link
Contributor

Sidecar Version Check Failed (ca54eea)

OpenAPI spec version mismatch:

Make sure to copy https://github.com/confluentinc/ide-sidecar/blob/v0.161.0/src/generated/resources/openapi.yaml to sidecar.openapi.yaml

@semaphore-agent-production
Copy link
Contributor

Sidecar Version Check Failed (8fd6f48)

Client code version mismatch:

Make sure to run gulp apigen to regenerate sidecar client code

This reverts commit 8fd6f48.
@shouples shouples marked this pull request as ready for review February 21, 2025 22:40
@Copilot Copilot bot review requested due to automatic review settings February 21, 2025 22:40
@shouples shouples requested a review from a team as a code owner February 21, 2025 22:40
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

- name: Validate Sidecar Version
pipeline_file: validate-sidecar-version.yml
auto_promote:
when: "result = 'passed' and change_in(['.versions/ide-sidecar.txt', 'src/clients/sidecar-openapi-specs/sidecar.openapi.yaml'])"
Copy link
Preview

Copilot AI Feb 21, 2025

Choose a reason for hiding this comment

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

The auto_promote condition references 'src/clients/sidecar-openapi-specs/sidecar.openapi.yaml' for the OpenAPI spec version check, but the PR description mentions validating the client code version in 'src/clients/sidecar/runtime.ts'. Please verify that the correct file is monitored for changes.

Suggested change
when: "result = 'passed' and change_in(['.versions/ide-sidecar.txt', 'src/clients/sidecar-openapi-specs/sidecar.openapi.yaml'])"
when: "result = 'passed' and change_in(['.versions/ide-sidecar.txt', 'src/clients/sidecar/runtime.ts'])"

Copilot is powered by AI, so mistakes are possible. Review output carefully before use.

Positive Feedback
Negative Feedback

Provide additional feedback

Please help us improve GitHub Copilot by sharing more details about this comment.

Please select one or more of the options
Copy link
Contributor Author

@shouples shouples Feb 21, 2025

Choose a reason for hiding this comment

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

We care more about changes to sidecar.openapi.yaml, which should be followed up by gulp apigen (which then changes clients/**/runtime.ts files). No need to explicitly check for any changes to runtime.ts here.

Copy link
Contributor

Choose a reason for hiding this comment

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

Good bot, try again next time.

Copy link
Contributor

@rohitsanj rohitsanj left a comment

Choose a reason for hiding this comment

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

This is great!! LGTM.

@shouples shouples merged commit 491982a into main Feb 21, 2025
2 checks passed
@shouples shouples deleted the djs/check-sidecar-version-ci branch February 21, 2025 22:49
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