Skip to content

Conversation

blva
Copy link
Collaborator

@blva blva commented Nov 12, 2024

Proposed changes

Jira ticket: CLOUDP-279336

Similar to this: https://github.com/10gen/mms/blob/2bdd398c7ede9d7d1e58519c6931fb1dbae13a36/scripts/api_versioning/changelog/generate_changelog.py#L197-L204

As part of investigating exemptions, I also noticed we weren't accounting for hiddenFromChangelog values while squashing, which could end up overriding the hide value. I'm following a similar logic to the one in current changelog above to fix it and updated all tests.

Checklist

  • I have signed the MongoDB CLA
  • I have added tests that prove my fix is effective or that my feature works

Changes to Spectral

  • I have read the README file for Spectral Updates

Further comments

@blva blva marked this pull request as ready for review November 12, 2024 21:19
@blva blva requested a review from a team as a code owner November 12, 2024 21:19
Copy link
Collaborator

@andreaangiolillo andreaangiolillo left a comment

Choose a reason for hiding this comment

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

Only one open question, the other comments are not blocking

// EntryMappings groups entries by ID and then by OperationID and returns a Map[changeCode, Map[operationId, List[oasdiffEntry]]]
func newEntriesMapPerIDAndOperationID(entries []*OasDiffEntry) map[string]map[string][]*OasDiffEntry {
result := make(map[string]map[string][]*OasDiffEntry)
func newEntriesMapPerIDAndOperationID(entries []*OasDiffEntry) (result, hiddenResult map[string]map[string][]*OasDiffEntry) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

could you update the function comment to include the new returned map?

Comment on lines 129 to 131
if _, exists := hiddenResult[code]; !exists {
hiddenResult[code] = make(map[string][]*OasDiffEntry)
}
Copy link
Collaborator

@andreaangiolillo andreaangiolillo Nov 13, 2024

Choose a reason for hiding this comment

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

Shouldn't you create a new entry in the map only if there is at least one entry hidden? if yes., you add this inside the hidden if

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 could but the way its being done for the visible ones is like this, both end up adding the code into the map before, even if there are no entries. in that case I can do that for both, I just wasn't sure if this statement existed to cover some corner case I'm not aware of

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'm making the change and not finding any failures so lets try that!

Copy link
Collaborator

@andreaangiolillo andreaangiolillo left a comment

Choose a reason for hiding this comment

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

LGTM

@blva blva merged commit 0b82932 into main Nov 13, 2024
10 checks passed
@blva blva deleted the CLOUDP-279336-2-2 branch November 13, 2024 10:35
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