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

[2.9] Use BundleDeployment status to calculate GitRepo resources #12443

Open
wants to merge 28 commits into
base: release-2.9
Choose a base branch
from

Conversation

aruiz14
Copy link
Contributor

@aruiz14 aruiz14 commented Oct 31, 2024

Summary

Fixes #12517

Occurred changes and/or fixed issues

GitRepo details include a tab for Resources, which iterates over the list of status.resources in the GitRepo object. However, this is inaccurate, since the source of truth for resources are BundleDeployments, as they may vary depending on the target cluster customization.

Technical notes summary

  • The code used find to pick just the first bundle deployment matching the cluster label, which is totally wrong. Now we iterate directly on bundle deployments instead, then pick the target cluster as necessary.
  • The biggest part of the Bundles payload is the spec.resources, as it basically contains all the raw chart contents. I've modified the getter to make steve omit that field.
    • In order to allow this, I also had to refactor the Bundle view to not use the spec for listing resources (and use the status instead).

Areas or cases that should be tested

  • Continuous Delivery: GitRepos
  • Continuous Delivery: Advanced > Bundles

Areas which could experience regressions

This PR actually aims to provide the same output while changing how the information is computed.

Screenshot/Video

Checklist

  • The PR is linked to an issue and the linked issue has a Milestone, or no issue is needed
  • The PR has a Milestone
  • The PR template has been filled out
  • The PR has been self reviewed
  • The PR has a reviewer assigned
  • The PR has automated tests or clear instructions for manual tests and the linked issue has appropriate QA labels, or tests are not needed
  • The PR has reviewed with UX and tested in light and dark mode, or there are no UX changes

@aruiz14 aruiz14 force-pushed the rework-gitrepo-status-resources-2.9 branch from ff3a824 to 8636de0 Compare October 31, 2024 13:04
Copy link
Contributor

@moio moio left a comment

Choose a reason for hiding this comment

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

LGTM as a first glance.

Not sure if applicable unit tests exist?

.vscode/launch.json Outdated Show resolved Hide resolved
shell/components/fleet/FleetRepos.vue Show resolved Hide resolved
shell/models/fleet.cattle.io.gitrepo.js Outdated Show resolved Hide resolved
@moio
Copy link
Contributor

moio commented Oct 31, 2024

Also: linter failing.

@richard-cox richard-cox added this to the v2.9.5 milestone Oct 31, 2024
Copy link
Member

@richard-cox richard-cox left a comment

Choose a reason for hiding this comment

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

haven't done much functional testing. once we work through some of the code review items will crack on

shell/pages/c/_cluster/fleet/index.vue Show resolved Hide resolved
shell/detail/fleet.cattle.io.bundle.vue Show resolved Hide resolved
shell/detail/fleet.cattle.io.bundle.vue Outdated Show resolved Hide resolved
shell/detail/fleet.cattle.io.bundle.vue Outdated Show resolved Hide resolved
shell/models/fleet.cattle.io.gitrepo.js Outdated Show resolved Hide resolved
shell/models/fleet.cattle.io.gitrepo.js Outdated Show resolved Hide resolved
shell/models/fleet.cattle.io.gitrepo.js Outdated Show resolved Hide resolved
shell/models/fleet.cattle.io.gitrepo.js Outdated Show resolved Hide resolved
shell/models/fleet.cattle.io.gitrepo.js Outdated Show resolved Hide resolved
shell/models/fleet.cattle.io.gitrepo.js Show resolved Hide resolved
@aruiz14 aruiz14 force-pushed the rework-gitrepo-status-resources-2.9 branch from 5dec55e to 93b259e Compare November 4, 2024 15:26
shell/utils/fleet.ts Outdated Show resolved Hide resolved
shell/utils/fleet.ts Outdated Show resolved Hide resolved
shell/utils/fleet.ts Outdated Show resolved Hide resolved
shell/utils/fleet.ts Outdated Show resolved Hide resolved
shell/utils/fleet.ts Outdated Show resolved Hide resolved
shell/utils/fleet.ts Outdated Show resolved Hide resolved
shell/utils/fleet.ts Outdated Show resolved Hide resolved
shell/detail/fleet.cattle.io.bundle.vue Outdated Show resolved Hide resolved
Copy link
Member

@richard-cox richard-cox left a comment

Choose a reason for hiding this comment

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

I'm looking into the bug that fails to show the correct resource state (reopened comment)

shell/utils/fleet.ts Outdated Show resolved Hide resolved
shell/utils/fleet.ts Outdated Show resolved Hide resolved
shell/utils/fleet.ts Outdated Show resolved Hide resolved
shell/utils/fleet.ts Outdated Show resolved Hide resolved
shell/utils/fleet.ts Outdated Show resolved Hide resolved
shell/types/resources/fleet.d.ts Outdated Show resolved Hide resolved
shell/detail/fleet.cattle.io.bundle.vue Outdated Show resolved Hide resolved
shell/models/fleet.cattle.io.gitrepo.js Outdated Show resolved Hide resolved
Copy link
Member

@richard-cox richard-cox left a comment

Choose a reason for hiding this comment

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

Looks good now. Just blocked on branch opening up to 2.9.5 changes (and e2e tests passing)

@aruiz14 aruiz14 changed the title Use BundleDeployment status to calculate GitRepo resources [2.9] Use BundleDeployment status to calculate GitRepo resources Nov 6, 2024
aruiz14 added a commit that referenced this pull request Nov 7, 2024
Use BundleDeployment status to calculate GitRepo resources
@moio moio self-requested a review November 8, 2024 14:54
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.

3 participants