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

CLOUDP-266446: migrate endpoint config to FOASCLI #151

Merged
merged 7 commits into from
Aug 9, 2024

Conversation

andreaangiolillo
Copy link
Collaborator

@andreaangiolillo andreaangiolillo commented Aug 9, 2024

Proposed changes

Jira ticket: CLOUDP-266446

This PR proposes the following changes:

  • Migrates the endpoint config to FOASCLI. This logic is required to then migrate the sunset logic.
  • Add the struct and function to load the current changelog

@andreaangiolillo andreaangiolillo marked this pull request as ready for review August 9, 2024 13:50
@andreaangiolillo andreaangiolillo requested a review from a team as a code owner August 9, 2024 13:50
@@ -24,7 +24,7 @@ import (

const lan = "en" // language for localized output

type Entry struct {
type OasDiffEntry struct {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Copy link
Collaborator

Choose a reason for hiding this comment

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

note - if any benefit, not in this PR anyways

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Are you proposing to use ApiChange instead of OasDiffEntry or to add ApiChange inside OasDiffEntry?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Oasdiff entry could be composed by ApiChange + our fields since we still need HideFromChangelog - but only if we see any benefit

Comment on lines +163 to +168
// replaceOnlyFirstOccurrence replaces only the first occurrence of the identifierRegex
// in the template with the valuesToAddToTemplate.
// Why do we need to replace only the first occurrence?
// OasDiffEntry.Text may have messages with multiple values enclosed in single quotes such as
// "added the new 'DUBLIN_IRL' enum value to the '/items/dataProcessRegion/region' response property".
// In this scenario, calling ReplaceAllStringFunc will also replace '/items/dataProcessRegion/region' which is not intended.
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Addressed comment from previous PR

}

manualChangelogEntries := make(map[string]string)
if value, ok := operation.Extensions["x-manual-changelog-entries"]; ok {
Copy link
Collaborator

Choose a reason for hiding this comment

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

[q] in python we get manual_changelog_entries = operation_def.get("x-xgen-changelog", {}), is this correct?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

this was a miss on my side. This comment also helped me noticing that I missed the unit tests for this scenario. I update the code and added the tests. Thanks!

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 5312598 into main Aug 9, 2024
8 checks passed
@andreaangiolillo andreaangiolillo deleted the CLOUDP-266446 branch August 9, 2024 15:37
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