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

Use the public product versions API for creating the versions list #4423

Merged
merged 5 commits into from
Mar 21, 2024

Conversation

rdner
Copy link
Member

@rdner rdner commented Mar 18, 2024

What does this PR do?

Replacing the artifact API with the more stable source.

Why is it important?

So, our versions list file is compiled with valid/published versions.

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
    - [ ] I have made corresponding changes to the documentation
    - [ ] I have made corresponding change to the default configuration files
  • I have added tests that prove my fix is effective or that my feature works
    - [ ] I have added an entry in ./changelog/fragments using the changelog tool
    - [ ] I have added an integration test or an E2E test

How to test this PR locally

mage integration:updateVersions

Related issues

Sorry, something went wrong.

@rdner rdner self-assigned this Mar 18, 2024
@rdner rdner force-pushed the fetch-versions-from-public-source branch 4 times, most recently from 6ea9ea0 to 388afd0 Compare March 19, 2024 10:54

Verified

This commit was signed with the committer’s verified signature.
rdner Denis
Replacing the artifact API with the more stable source.
@rdner rdner force-pushed the fetch-versions-from-public-source branch from 388afd0 to b17b3ac Compare March 19, 2024 10:55
@rdner rdner requested review from cmacknz, blakerouse and pchila March 19, 2024 12:53
@rdner rdner marked this pull request as ready for review March 19, 2024 12:53
@rdner rdner requested a review from a team as a code owner March 19, 2024 12:53
@elasticmachine
Copy link
Contributor

Pinging @elastic/elastic-agent (Team:Elastic-Agent)

rdner added 2 commits March 19, 2024 22:11

Verified

This commit was signed with the committer’s verified signature.
rdner Denis

Verified

This commit was signed with the committer’s verified signature.
rdner Denis
Comment on lines +1596 to +1597
// uncomment if want to have the current version snapshot on the list as well
// branches = append([]string{"master"}, branches...)
Copy link
Member Author

Choose a reason for hiding this comment

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

It's not necessary to have the current version snapshot on this list because we have plenty of tests that use it for upgrade/downgrade already. So, I skipped it to make the tests run faster.

Copy link
Member

@pchila pchila left a comment

Choose a reason for hiding this comment

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

Code looks good, just a couple of questions here and there, no major blocker

@@ -156,26 +136,10 @@ func NewArtifactAPIClient(opts ...ArtifactAPIClientOpt) *ArtifactAPIClient {
return c
}

// GetVersions returns a list of versions as server by the Artifact API along with some aliases and manifest information
Copy link
Member

Choose a reason for hiding this comment

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

I understand that this function and the types above are not used by the new version of testing code but they are still existing operations and types of Artifact API, I would prefer to leave them there

Copy link
Member Author

Choose a reason for hiding this comment

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

The artifact API is deprecated and we must eventually get rid of it entirely. Deleting these functions will make sure we're not using them again.

Copy link
Member

Choose a reason for hiding this comment

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

Since the datamodel is shared with the DRA manifests we need to make sure we don't delete too much.
As for this client, it was not about what we have to use in the tests, just a simple client that made accessing the snapshot API easier regardless of how it has been used. For the deprecation a simple Deprecated: comment on the client itself would suffice.

Verified

This commit was signed with the committer’s verified signature.
rdner Denis
@rdner rdner requested a review from pchila March 21, 2024 10:21

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
@rdner rdner enabled auto-merge (squash) March 21, 2024 15:12
Copy link

Quality Gate passed Quality Gate passed

Kudos, no new issues were introduced!

0 New issues
0 Security Hotspots
No Coverage information No data about Coverage
0.0% 0.0% Duplication on New Code

See analysis details on SonarQube

@rdner rdner merged commit 8fc1874 into elastic:main Mar 21, 2024
9 checks passed
@rdner rdner deleted the fetch-versions-from-public-source branch April 2, 2024 18:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Find another source for versions list other than the artifact API
4 participants