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

Bug 1973065: Preserve user annotations while editing an app #9315

Merged
merged 2 commits into from Jun 29, 2021

Conversation

divyanshiGupta
Copy link
Contributor

Fixes: https://issues.redhat.com/browse/OCPBUGSM-31048

Analysis/Root Cause:
Annotations cannot be edited directly via edit flows like labels but the default annotations values are updated if one or more form field values are modified. In order to keep the default annotations values up-to date old annotations were not being added and in turn the user annotations were also being lost.

Solution:
Only update the default annotations and keep the user annotations as is.

Screen-recording:

Screen.Recording.2021-06-22.at.8.26.37.PM.mov

Test coverage:
Screenshot 2021-06-22 at 8 29 17 PM

/kind bug

@openshift-ci openshift-ci bot added the kind/bug Categorizes issue or PR as related to a bug. label Jun 22, 2021
@openshift-ci openshift-ci bot added component/dev-console Related to dev-console bugzilla/severity-high Referenced Bugzilla bug's severity is high for the branch this PR is targeting. bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. labels Jun 22, 2021
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jun 22, 2021

@divyanshiGupta: This pull request references Bugzilla bug 1973065, which is valid. The bug has been moved to the POST state. The bug has been updated to refer to the pull request using the external bug tracker.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target release (4.9.0) matches configured target release for branch (4.9.0)
  • bug is in the state NEW, which is one of the valid states (NEW, ASSIGNED, ON_DEV, POST, POST)

No GitHub users were found matching the public email listed for the QA contact in Bugzilla (gamore@redhat.com), skipping review request.

In response to this:

Bug 1973065: Preserve user annotations while editing an app

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.

@divyanshiGupta
Copy link
Contributor Author

/cc: @andrewballantyne

Copy link
Contributor

@andrewballantyne andrewballantyne left a comment

Choose a reason for hiding this comment

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

@rohitkrai03 / @christianvogt Did you guys wanna chime in here?

'image.openshift.io/triggers',
'alpha.image.policy.openshift.io/resolve-names',
'jarFileName',
];
Copy link
Contributor

Choose a reason for hiding this comment

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

So we dropped 'kubectl.kubernetes.io/last-applied-configuration' as well in the Pipeline world.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You meant that this annotation should be added here too?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes that is what I am suggesting... Hmmm, this flow is only for editing or also for some creating? I don't think you can create a resource with 'kubectl.kubernetes.io/last-applied-configuration'. I think the Devfile flow is a bit different during it's create resources that are crafted by the backend. If we copy two resources to create, I am 90% sure this will block the resource creation. At least it did for Pipelines: https://issues.redhat.com/browse/ODC-4917

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hmm I think we might want to remove it as I saw this annotation in other resources as well though we dont add this specifically from our add flows but it might interfere with updating the resources like it probably did with PipelineRuns though I am not 100% sure.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think updates are different than creates. Updates I wanna say are good with this annotation being echoed because it's an update. But I don't think you can create a resource with it... I should try to test once I get a moment today to make sure my representation of the world is actually correct lol.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We are not creating any resource with this annotation from add flows and I dont think that we have a similar case as PipelineRuns here or I am not aware of it.

Copy link
Contributor

Choose a reason for hiding this comment

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

Hmmm, okay, let's ignore this thread -- I'm having issues reproducing it but my cluster went down as I was playing with various K8s / CRD kinds. Clearly this doesn't seem to fit the issue at hand, at least not directly.

Edit: Ah you added it anyways. Appreciate that, shouldn't be a problem having it there.

@divyanshiGupta
Copy link
Contributor Author

/assign @rohitkrai03

Copy link
Contributor

@andrewballantyne andrewballantyne left a comment

Choose a reason for hiding this comment

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

Tested, lgtm. Definitely would help seeing if there are any other annotations that we want to be weary of... But this should be a good one to back port.

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 28, 2021
Copy link
Contributor

@rohitkrai03 rohitkrai03 left a comment

Choose a reason for hiding this comment

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

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Jun 29, 2021
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jun 29, 2021

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: andrewballantyne, divyanshiGupta, rohitkrai03

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

The pull request process is described here

Needs approval from an approver in each of these files:

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

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

1 similar comment
@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-merge-robot openshift-merge-robot merged commit e2df370 into openshift:master Jun 29, 2021
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jun 29, 2021

@divyanshiGupta: All pull requests linked via external trackers have merged:

Bugzilla bug 1973065 has been moved to the MODIFIED state.

In response to this:

Bug 1973065: Preserve user annotations while editing an app

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.

@andrewballantyne
Copy link
Contributor

/cherry-pick release-4.8

@openshift-cherrypick-robot

@andrewballantyne: new pull request created: #9381

In response to this:

/cherry-pick release-4.8

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.

@spadgett spadgett added this to the v4.9 milestone Jul 14, 2021
@divyanshiGupta
Copy link
Contributor Author

/cherry-pick release-4.7

@openshift-cherrypick-robot

@divyanshiGupta: new pull request created: #9714

In response to this:

/cherry-pick release-4.7

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.

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. bugzilla/severity-high Referenced Bugzilla bug's severity is high for the branch this PR is targeting. bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. component/dev-console Related to dev-console kind/bug Categorizes issue or PR as related to a bug. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants