Skip to content

Conversation

@andreaangiolillo
Copy link
Collaborator

@andreaangiolillo andreaangiolillo commented Feb 28, 2025

Proposed changes

Ticket: CLOUDP-303647

Bug

While migrating the API to preview in this PR https://github.com/10gen/mms/pull/122517, I noticed that the request body for the endpoint was not being populated. After reproducing the issue locally, I found the root cause: we use time.Now() with the preview API, and when comparing the content type for preview using time.GreaterThan, the comparison always returned true. This happened because time.GreaterThan was factoring in minutes and seconds, even though both versions were set to preview.

Fix

I updated the logic to use the same date as we have in Atlas so that we don't set HH:MM:SS.
I regenerated the preview spec locally and confirmed that the request body was correctly populated.

@andreaangiolillo andreaangiolillo marked this pull request as ready for review February 28, 2025 16:59
@andreaangiolillo andreaangiolillo requested a review from a team as a code owner February 28, 2025 16:59
"github.com/mongodb/openapi/tools/cli/internal/apiversion"
)

// Filter: VersioningFilter is a filter that modifies the OpenAPI spec by removing operations and responses
Copy link
Collaborator

Choose a reason for hiding this comment

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

// Filter: notation is used so that we can auto gen all the filters

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

ah I was getting a warning in my IDE that this is not golang standard. I will revert the changes

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 reverted my changes. 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.

nice! a great benefit of moving over to foascli, now our feedback loop is much quicker to fix issues

@andreaangiolillo andreaangiolillo merged commit 7efacd3 into main Feb 28, 2025
11 checks passed
@andreaangiolillo andreaangiolillo deleted the fix_split_command_preview branch February 28, 2025 17:11
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