api icon indicating copy to clipboard operation
api copied to clipboard

OCPBUGS-35196: Insights types - fix duration validation

Open tremes opened this issue 1 year ago • 4 comments
trafficstars

This is to unify the duration's validation pattern used in the Insights API. I noticed this problem when the operator status failed to update with having duration value as 2m0s

tremes avatar Jun 06 '24 11:06 tremes

Hello @tremes! Some important instructions when contributing to openshift/api: API design plays an important part in the user experience of OpenShift and as such API PRs are subject to a high level of scrutiny to ensure they follow our best practices. If you haven't already done so, please review the OpenShift API Conventions and ensure that your proposed changes are compliant. Following these conventions will help expedite the api review process for your PR.

openshift-ci[bot] avatar Jun 06 '24 11:06 openshift-ci[bot]

@tremes: This pull request references Jira Issue OCPBUGS-35196, which is valid. The bug has been moved to the POST state.

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

Requesting review from QA contact: /cc @JoaoFula

The bug has been updated to refer to the pull request using the external bug tracker.

In response to this:

This is to unify the duration's validation pattern used in the Insights API. I noticed this problem when the operator status failed to update with having duration value as 2m0s

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 avatar Jun 10 '24 07:06 openshift-ci-robot

Issues go stale after 90d of inactivity.

Mark the issue as fresh by commenting /remove-lifecycle stale. Stale issues rot after an additional 30d of inactivity and eventually close. Exclude this issue from closing by commenting /lifecycle frozen.

If this issue is safe to close now please do so with /close.

/lifecycle stale

openshift-bot avatar Nov 14 '24 01:11 openshift-bot

/remove-lifecycle stale

tremes avatar Nov 14 '24 06:11 tremes

@JoelSpeed would you please find some time for this one?

tremes avatar Nov 14 '24 06:11 tremes

If my regex reading skills are up to scratch, all existing values should still match this validation, and we are allowing more values, that we weren't before.

@tremes, did this regex come from somewhere? How confident are we that it matches the go duration validation? Perhaps we can add some tests?

JoelSpeed avatar Nov 20 '24 23:11 JoelSpeed

@JoelSpeed OK let me try to add some tests.

tremes avatar Nov 29 '24 10:11 tremes

I've added few tests for this one and updated the regex a little bit.

Please check @JoelSpeed, Thank you

tremes avatar Dec 02 '24 14:12 tremes

/lgtm

JoelSpeed avatar Dec 09 '24 13:12 JoelSpeed

/hold

Good spot @everettraven , @tremes this isn't one of those odd unicode mu things is it? Are they separate chars?

JoelSpeed avatar Dec 09 '24 15:12 JoelSpeed

@JoelSpeed it's not. Fixed. Thanks @everettraven

tremes avatar Dec 10 '24 07:12 tremes

@tremes: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/e2e-aws-ovn ae3ef30560c8f97a1665d68d2fa0638812e3ce14 link true /test e2e-aws-ovn
ci/prow/e2e-upgrade-minor ae3ef30560c8f97a1665d68d2fa0638812e3ce14 link true /test e2e-upgrade-minor
ci/prow/e2e-aws-ovn-hypershift ae3ef30560c8f97a1665d68d2fa0638812e3ce14 link true /test e2e-aws-ovn-hypershift
ci/prow/e2e-upgrade ae3ef30560c8f97a1665d68d2fa0638812e3ce14 link true /test e2e-upgrade
ci/prow/e2e-aws-serial ae3ef30560c8f97a1665d68d2fa0638812e3ce14 link true /test e2e-aws-serial
ci/prow/e2e-aws-serial-techpreview ae3ef30560c8f97a1665d68d2fa0638812e3ce14 link true /test e2e-aws-serial-techpreview
ci/prow/e2e-aws-ovn-techpreview ae3ef30560c8f97a1665d68d2fa0638812e3ce14 link true /test e2e-aws-ovn-techpreview
ci/prow/minor-e2e-upgrade-minor ae3ef30560c8f97a1665d68d2fa0638812e3ce14 link true /test minor-e2e-upgrade-minor

Full PR test history. Your PR dashboard.

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-sigs/prow repository. I understand the commands that are listed here.

openshift-ci[bot] avatar Dec 10 '24 08:12 openshift-ci[bot]

/hold cancel /lgtm

JoelSpeed avatar Dec 11 '24 14:12 JoelSpeed

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: JoelSpeed, tremes

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[bot] avatar Dec 11 '24 14:12 openshift-ci[bot]

@tremes: Jira Issue OCPBUGS-35196: All pull requests linked via external trackers have merged:

Jira Issue OCPBUGS-35196 has been moved to the MODIFIED state.

In response to this:

This is to unify the duration's validation pattern used in the Insights API. I noticed this problem when the operator status failed to update with having duration value as 2m0s

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 avatar Dec 11 '24 14:12 openshift-ci-robot