Skip to content

Conversation

andreaangiolillo
Copy link
Collaborator

@andreaangiolillo andreaangiolillo commented Jun 9, 2025

Proposed changes

CLOUDP-311382

This PR proposes the following changes:

  • updates the foas changelog metadata create to consider upcoming API version when generating the metadata file
  • updates the foas changelog create to skip upcoming api version when generating the changelog. The support will be added in CLOUDP-315486

Next

I will test the changes once the PR is merged by running the FOAS release. I may have to create follow up PRs to fix the release flow.

@andreaangiolillo andreaangiolillo marked this pull request as ready for review June 9, 2025 08:05
@andreaangiolillo andreaangiolillo requested a review from a team as a code owner June 9, 2025 08:05
// Validate that the API version use the correct date format YYYY-MM-DD
for _, version := range o.versions {
// Upcoming version has the format YYYY-MM-DD.upcoming, here we remove .upcoming to validate the date format.
version = strings.ReplaceAll(version, ".upcoming", "")
Copy link
Collaborator

Choose a reason for hiding this comment

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

this is where I suggested to simply try to use apiversion.go and create a new version, throwing an error if it's invalid, that way you don't need to maintain two different logics to parse versions

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yes, good point. I updated the logic to reuse apiversion.go

Copy link
Collaborator

@blva blva left a comment

Choose a reason for hiding this comment

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

non-blocking comments

Copy link
Collaborator

@blva blva left a comment

Choose a reason for hiding this comment

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

LGTM thanks for the changes

@andreaangiolillo andreaangiolillo merged commit 07f40c5 into main Jun 9, 2025
10 checks passed
@andreaangiolillo andreaangiolillo deleted the CLOUDP-311382 branch June 9, 2025 10:27
opts := &Opts{
specRevision: "test",
runDate: "2024-01-01",
versions: []string{"2024-01-01.upcoming", "2025-01-01"},
Copy link
Member

Choose a reason for hiding this comment

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

Q: is there chance for us to migrate from string to object with multiple keys in the future?
Not sure how much involved it would be, asking curious question.

Thinking of all code generation tools we need to invent some parser for custom date format and prefixes

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

we have already the version struct here. You can create a new version struct from a string with this piece of code: apiVersion, err := apiversion.New(apiversion.WithVersion(version));. I am updating foascli to use always this struct where possible

Copy link
Member

Choose a reason for hiding this comment

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

@andreaangiolillo Thank you. Awesome news! Unification can help platform and integrations team as well as we see questions to support stability levels through SDK + other generation methods.

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Collaborator Author

@andreaangiolillo andreaangiolillo Jun 9, 2025

Choose a reason for hiding this comment

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

no, it won't change. It will still be a JSON array. You will start to see upcoming entries like this one:

[
  "2023-01-01",
  "2023-02-01",
  "2023-10-01",
  "2023-11-15",
  "2024-05-30",
  "2024-08-05",
  "2024-10-23",
  "2024-11-13",
  "2025-02-19",
  "2025-03-12"
  "2025-03-12.upcoming"
]

There was an issue last week on the dev SDK about this change and was fixed: https://mongodb.slack.com/archives/CHEULRC9W/p1749200548092979?thread_ts=1749199877.955329&cid=CHEULRC9W

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.

3 participants