Skip to content

MGMT-17503: Fix the cpu architectures retrieved in ../openshift-versions endpoint - #6184

Merged
openshift-merge-bot[bot] merged 1 commit into
openshift:masterfrom
danmanor:fix-latest-diffs
Apr 18, 2024
Merged

openshift-merge-bot[bot] merged 1 commit into
openshift:masterfrom
danmanor:fix-latest-diffs

Conversation

@danmanor

@danmanor danmanor commented Apr 14, 2024 •

Copy link
Copy Markdown
Contributor

Currently when requesting the latest openshift versions at ../openshift-versions?only_latest=true, you get at most one CPU architecture in the list. This PR fixes that issue.

List all the issues related to this PR

  • New Feature
  • Enhancement
  • Bug fix
  • Tests
  • Documentation
  • CI/CD

What environments does this code impact?

  • Automation (CI, tools, etc)
  • Cloud
  • Operator Managed Deployments
  • None

How was this code tested?

  • assisted-test-infra environment
  • dev-scripts environment
  • Reviewer's test appreciated
  • Waiting for CI to do a full test run
  • Manual (Elaborate on how it was tested)
  • No tests needed

Checklist

  • Title and description added to both, commit and PR.
  • Relevant issues have been associated (see CONTRIBUTING guide)
  • This change does not require a documentation update (docstring, docs, README, etc)
  • Does this change include unit-tests (note that code changes require unit-tests)

Reviewers Checklist

  • Are the title and description (in both PR and commit) meaningful and clear?
  • Is there a bug required (and linked) for this change?
  • Should this PR be backported?

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Apr 14, 2024
@openshift-ci-robot

openshift-ci-robot commented Apr 14, 2024 •

Copy link
Copy Markdown

@danmanor: This pull request references MGMT-17503 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the bug to target the "4.16.0" version, but no target version was set.

Details

In response to this:

Currently when requesting the latest openshift versions at ../openshift-versions?only_latest=true, you get at most one CPU architecture in the list. This PR fixes that issue.

List all the issues related to this PR

  • New Feature
  • Enhancement
  • Bug fix
  • Tests
  • Documentation
  • CI/CD

What environments does this code impact?

  • Automation (CI, tools, etc)
  • Cloud
  • Operator Managed Deployments
  • None

How was this code tested?

  • assisted-test-infra environment
  • dev-scripts environment
  • Reviewer's test appreciated
  • Waiting for CI to do a full test run
  • Manual (Elaborate on how it was tested)
  • No tests needed

Checklist

  • Title and description added to both, commit and PR.
  • Relevant issues have been associated (see CONTRIBUTING guide)
  • This change does not require a documentation update (docstring, docs, README, etc)
  • Does this change include unit-tests (note that code changes require unit-tests)

Reviewers Checklist

  • Are the title and description (in both PR and commit) meaningful and clear?
  • Is there a bug required (and linked) for this change?
  • Should this PR be backported?

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci-robot

openshift-ci-robot commented Apr 14, 2024 •

Copy link
Copy Markdown

@danmanor: This pull request references MGMT-17503 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the bug to target the "4.16.0" version, but no target version was set.

Details

In response to this:

Currently when requesting the latest openshift versions at ../openshift-versions?only_latest=true, you get at most one CPU architecture in the list. This PR fixes that issue.

List all the issues related to this PR

  • New Feature
  • Enhancement
  • Bug fix
  • Tests
  • Documentation
  • CI/CD

What environments does this code impact?

  • Automation (CI, tools, etc)
  • Cloud
  • Operator Managed Deployments
  • None

How was this code tested?

  • assisted-test-infra environment
  • dev-scripts environment
  • Reviewer's test appreciated
  • Waiting for CI to do a full test run
  • Manual (Elaborate on how it was tested)
  • No tests needed

Checklist

  • Title and description added to both, commit and PR.
  • Relevant issues have been associated (see CONTRIBUTING guide)
  • This change does not require a documentation update (docstring, docs, README, etc)
  • Does this change include unit-tests (note that code changes require unit-tests)

Reviewers Checklist

  • Are the title and description (in both PR and commit) meaningful and clear?
  • Is there a bug required (and linked) for this change?
  • Should this PR be backported?

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci-robot

openshift-ci-robot commented Apr 14, 2024 •

Copy link
Copy Markdown

@danmanor: This pull request references MGMT-17503 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the bug to target the "4.16.0" version, but no target version was set.

Details

In response to this:

Currently when requesting the latest openshift versions at ../openshift-versions?only_latest=true, you get at most one CPU architecture in the list. This PR fixes that issue.

List all the issues related to this PR

  • New Feature
  • Enhancement
  • Bug fix
  • Tests
  • Documentation
  • CI/CD

What environments does this code impact?

  • Automation (CI, tools, etc)
  • Cloud
  • Operator Managed Deployments
  • None

How was this code tested?

  • assisted-test-infra environment
  • dev-scripts environment
  • Reviewer's test appreciated
  • Waiting for CI to do a full test run
  • Manual (Elaborate on how it was tested)
  • No tests needed

Checklist

  • Title and description added to both, commit and PR.
  • Relevant issues have been associated (see CONTRIBUTING guide)
  • This change does not require a documentation update (docstring, docs, README, etc)
  • Does this change include unit-tests (note that code changes require unit-tests)

Reviewers Checklist

  • Are the title and description (in both PR and commit) meaningful and clear?
  • Is there a bug required (and linked) for this change?
  • Should this PR be backported?

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@danmanor danmanor changed the title MGMT-17503: MGMT-17503: Fix the cpu architectures retrieved in ../openshift-versions endpoint MGMT-17503: Fix the cpu architectures retrieved in ../openshift-versions endpoint Apr 14, 2024
@openshift-ci openshift-ci Bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Apr 14, 2024
@openshift-ci
openshift-ci Bot requested review from javipolo and rccrdpccl April 14, 2024 11:53
@openshift-ci openshift-ci Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 14, 2024
@codecov

codecov Bot commented Apr 14, 2024 •

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 81.57895% with 7 lines in your changes are missing coverage. Please review.

Project coverage is 68.59%. Comparing base (4c9b414) to head (f5e3c07).
Report is 10 commits behind head on master.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #6184      +/-   ##
==========================================
+ Coverage   68.22%   68.59%   +0.37%     
==========================================
  Files         242      240       -2     
  Lines       35884    36330     +446     
==========================================
+ Hits        24481    24920     +439     
+ Misses       9276     9241      -35     
- Partials     2127     2169      +42     
Files Coverage Δ
internal/common/version.go 69.56% <66.66%> (-0.28%) ⬇️
internal/versions/api.go 79.61% <84.37%> (-1.97%) ⬇️

... and 13 files with indirect coverage changes

@danmanor

Copy link
Copy Markdown
Contributor Author

/test edge-subsystem-aws /test edge-subsystem-kubeapi-aws

@danmanor

Copy link
Copy Markdown
Contributor Author

/test edge-subsystem-kubeapi-aws
/test edge-subsystem-aws

@danmanor

Copy link
Copy Markdown
Contributor Author

/retest

1 similar comment
@danmanor

Copy link
Copy Markdown
Contributor Author

/retest

Comment thread internal/versions/api.go Outdated
Comment thread internal/versions/api.go Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
if *isEqual && !lo.Contains(latestReleaseImages, releaseImage) {
if *isEqual && !funk.Contains(latestReleaseImages, releaseImage) {

funk is already widely used in assisted, let's keep using it instead of introducing other dependencies to perform the same operations.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

lo it's strongly typed as opposed as funk which is not, and we introduced it already in some other parts of the code as not all lo operations are supported by funk.
Also we will probably deprecate both once we hit 1.22 (IIRC) which has generic slices operations built in

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I had a discussion with @rccrdpccl about it, I think we should start using lo instead, it is better

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Also we will probably deprecate both once we hit 1.22 (IIRC) which has generic slices operations built in

I agree, 1.22 will unify all these kind of libraries.

But I think we should avoid introducing new libraries that do almost the same thing than another one, even if that new library is technically better, I think consistency is more important, it avoids switching mentally between two libraries while reviewing. Already in this file, both libraries are in use.
Or we decide to go for the new one, and then we make the work to refactor over it.

lo is currently use only in this file https://github.com/openshift/assisted-service/blob/master/internal/operators/mce/mce_operator.go#L214, and go-funk already provide such functions: https://pkg.go.dev/github.com/thoas/go-funk?utm_source=godoc#Sum

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@adriengentil Do you think it worth running the tests again for? I think this is the only issue left

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I am also a fan of lo as you don't need to assert the type :)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think we should follow up on that because my concerns still stand. Once we will start to use go 1.22 we will have 3 different ways to do the same thing in this project.

image

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

eheheh

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done

Comment thread internal/versions/api.go Outdated
Comment thread internal/versions/api.go Outdated
Comment thread internal/common/version.go Outdated
Comment thread internal/versions/api.go Outdated
Comment thread internal/versions/api.go Outdated
Comment thread internal/versions/api.go Outdated
Comment thread internal/versions/api.go Outdated
@danmanor

Copy link
Copy Markdown
Contributor Author

/test images

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Apr 17, 2024
@openshift-ci-robot

Copy link
Copy Markdown

/retest-required

Remaining retests: 0 against base HEAD 29e748f and 2 for PR HEAD d3366b72cc85632e7f4e8dc585f40f8a645aedf7 in total

@openshift-ci openshift-ci Bot removed the lgtm Indicates that a PR is ready to be merged. label Apr 17, 2024
@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Apr 17, 2024
@openshift-ci

openshift-ci Bot commented Apr 17, 2024

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: adriengentil, danmanor

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:
  • OWNERS [adriengentil,danmanor]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci-robot

Copy link
Copy Markdown

/retest-required

Remaining retests: 0 against base HEAD 29e748f and 2 for PR HEAD f5e3c07 in total

@danmanor

Copy link
Copy Markdown
Contributor Author

/retest

1 similar comment
@danmanor

Copy link
Copy Markdown
Contributor Author

/retest

@danmanor

Copy link
Copy Markdown
Contributor Author

/test e2e-agent-compact-ipv4 images

@openshift-ci

openshift-ci Bot commented Apr 18, 2024

Copy link
Copy Markdown
Contributor

@danmanor: all tests passed!

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@openshift-merge-bot
openshift-merge-bot Bot merged commit dffc2f9 into openshift:master Apr 18, 2024
@danmanor

Copy link
Copy Markdown
Contributor Author

/cherry-pick cloud_hotfix_releases

@openshift-cherrypick-robot

Copy link
Copy Markdown

@danmanor: new pull request created: #6206

Details

In response to this:

/cherry-pick cloud_hotfix_releases

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@adriengentil adriengentil mentioned this pull request Jun 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants