Skip to content

Bug 1822396: Update metric when Subscription is updated #1603

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

Conversation

anik120
Copy link
Contributor

@anik120 anik120 commented Jun 25, 2020

Description of the change:

In #1519, the subscription_sync_total metric was updated when the
related subscription object was updated. However, the PR had a bug,
in which the map used to store metric related information was not
being updated when the metric was udpated. As a result of which any
update after the first update was not removing the old metric. This
PR fixes that bug.

Motivation for the change:

Reviewer Checklist

  • Implementation matches the proposed design, or proposal is updated to match implementation
  • Sufficient unit test coverage
  • Sufficient end-to-end test coverage
  • Docs updated or added to /docs
  • Commit messages sensible and descriptive

@openshift-ci-robot openshift-ci-robot added bugzilla/severity-medium Referenced Bugzilla bug's severity is medium 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 25, 2020
@openshift-ci-robot
Copy link
Collaborator

@anik120: This pull request references Bugzilla bug 1822396, 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.6.0) matches configured target release for branch (4.6.0)
  • bug is in the state ASSIGNED, which is one of the valid states (NEW, ASSIGNED, ON_DEV, POST, POST)

In response to this:

Bug 1822396: Update metric when Subscription is updated

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.

@anik120
Copy link
Contributor Author

anik120 commented Jun 25, 2020

/test e2e-aws-olm

2 similar comments
@anik120
Copy link
Contributor Author

anik120 commented Jun 25, 2020

/test e2e-aws-olm

@anik120
Copy link
Contributor Author

anik120 commented Jun 25, 2020

/test e2e-aws-olm

@openshift-ci-robot openshift-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 28, 2020
@anik120 anik120 force-pushed the subs_sync_metric_re-fix branch from 2583f2c to 447c11b Compare June 29, 2020 19:32
@openshift-ci-robot openshift-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 29, 2020
@anik120 anik120 force-pushed the subs_sync_metric_re-fix branch from 447c11b to c6e37ba Compare June 29, 2020 22:04
WithName("metric-subscription-for-update"),
WithChannel(alphaChannel),
WithPackage(testPackageName),
WithPackage(testPackageName),
Copy link
Contributor

Choose a reason for hiding this comment

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

It's harmless, but this line is duplicated.

@@ -267,5 +267,7 @@ func UpdateSubsSyncCounterStorage(sub *olmv1alpha1.Subscription) {
counterValues.installedCSV = sub.Status.InstalledCSV
counterValues.pkg = sub.Spec.Package
counterValues.channel = sub.Spec.Channel

subscriptionSyncCounters[sub.GetName()] = counterValues
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think it needs to block this bugfix, but there should really be some kind of synchronization around access to subscriptionSyncCounters. Would you be interested in making a separate PR with that change?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@benluddy sure! I'm curious to see what you mean by synchronization, once we discuss that I'd be happy to open up a PR if needed.

@benluddy
Copy link
Contributor

/approve

@openshift-ci-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: anik120, benluddy

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-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 30, 2020
@njhale
Copy link
Member

njhale commented Jun 30, 2020

/retest

2 similar comments
@anik120
Copy link
Contributor Author

anik120 commented Jun 30, 2020

/retest

@anik120
Copy link
Contributor Author

anik120 commented Jun 30, 2020

/retest

In operator-framework#1519, the subscription_sync_total metric was updated when the
related subscription object was updated. However, the PR had a bug,
in which the map used to store metric related information was not
being updated when the metric was udpated. As a result of which any
update after the first update was not removing the old metric. This
PR fixes that bug.
@anik120 anik120 force-pushed the subs_sync_metric_re-fix branch from c6e37ba to 2b658ed Compare June 30, 2020 17:16
@anik120
Copy link
Contributor Author

anik120 commented Jun 30, 2020

/test e2e-aws-console-olm

@njhale
Copy link
Member

njhale commented Jun 30, 2020

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Jun 30, 2020
@openshift-merge-robot openshift-merge-robot merged commit 6948192 into operator-framework:master Jun 30, 2020
@openshift-ci-robot
Copy link
Collaborator

@anik120: All pull requests linked via external trackers have merged: operator-framework/operator-lifecycle-manager#1603, operator-framework/operator-lifecycle-manager#1519. Bugzilla bug 1822396 has been moved to the MODIFIED state.

In response to this:

Bug 1822396: Update metric when Subscription is updated

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-medium Referenced Bugzilla bug's severity is medium 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. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants