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

OCPBUGS-16077: fix base domain name validation #2268

Conversation

ammont82
Copy link
Contributor

@ammont82 ammont82 commented Jul 20, 2023

Related to https://issues.redhat.com/browse/OCPBUGS-16077
Related to https://issues.redhat.com/browse/MGMT-15619

We need to align our regexp for base domain name validations with BE (openshift/assisted-service#5371 (comment)).
New regexps:

const BASE_DOMAIN_REGEX = /^[a-z\d][\-]*[a-z\d]+$/;
const DNS_NAME_REGEX_OCM = /^([a-z\d]([\-]*[a-z\d]+)*\.)+[a-z\d]+[\-]*[a-z\d]+$/;

Before changes:
not-valid-base-domain-name

After changes:
valid-base-domain-name png

@ammont82 ammont82 requested a review from a team as a code owner July 20, 2023 06:09
@openshift-ci-robot openshift-ci-robot added jira/severity-critical Referenced Jira bug's severity is critical for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels Jul 20, 2023
@openshift-ci-robot
Copy link

@ammont82: This pull request references Jira Issue OCPBUGS-16077, which is invalid:

  • expected the bug to target the "4.14.0" version, but no target version was set
  • expected the bug to be in one of the following states: NEW, ASSIGNED, POST, but it is MODIFIED instead

Comment /jira refresh to re-evaluate validity if changes to the Jira bug are made, or edit the title of this pull request to link to a different bug.

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

In response to this:

Related to https://issues.redhat.com/browse/OCPBUGS-16077

We need to align our regexp for base domain name validations with BE (openshift/assisted-service#5371 (comment)).
New regexps:

const BASE_DOMAIN_REGEX = /^[a-z\d][\-]*[a-z\d]+$/;
const DNS_NAME_REGEX_OCM = /^([a-z\d]([\-]*[a-z\d]+)*\.)+[a-z\d]+[\-]*[a-z\d]+$/;

Before changes:
not-valid-base-domain-name

After changes:
valid-base-domain-name png

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.

@ammont82 ammont82 added OCM and removed jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. labels Jul 20, 2023
@ammont82 ammont82 added this to the v2.24 milestone Jul 20, 2023
@openshift-ci openshift-ci bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Jul 20, 2023
@ammont82 ammont82 changed the title OCPBUGS-16077: base domain cat--rahul.com , it fails with an error OCPBUGS-16077: fix base domain name validation Jul 20, 2023
@ammont82 ammont82 removed this from the v2.24 milestone Jul 27, 2023
@openshift-ci-robot openshift-ci-robot added jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels Aug 22, 2023
@openshift-ci-robot
Copy link

@ammont82: This pull request references Jira Issue OCPBUGS-16077, which is invalid:

  • expected the bug to target the "4.14.0" version, but no target version was set
  • expected the bug to be in one of the following states: NEW, ASSIGNED, POST, but it is MODIFIED instead

Comment /jira refresh to re-evaluate validity if changes to the Jira bug are made, or edit the title of this pull request to link to a different bug.

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

In response to this:

Related to https://issues.redhat.com/browse/OCPBUGS-16077
Related to https://issues.redhat.com/browse/MGMT-15619

We need to align our regexp for base domain name validations with BE (openshift/assisted-service#5371 (comment)).
New regexps:

const BASE_DOMAIN_REGEX = /^[a-z\d][\-]*[a-z\d]+$/;
const DNS_NAME_REGEX_OCM = /^([a-z\d]([\-]*[a-z\d]+)*\.)+[a-z\d]+[\-]*[a-z\d]+$/;

Before changes:
not-valid-base-domain-name

After changes:
valid-base-domain-name png

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.

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Aug 22, 2023
@jkilzi
Copy link
Collaborator

jkilzi commented Aug 22, 2023

Please rebase

@openshift-ci
Copy link

openshift-ci bot commented Aug 22, 2023

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: ammont82, jgyselov, jkilzi

The full list of commands accepted by this bot can be found 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

@ammont82 ammont82 removed the jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. label Aug 22, 2023
@openshift-ci openshift-ci bot removed the lgtm Indicates that a PR is ready to be merged. label Aug 22, 2023
@openshift-ci
Copy link

openshift-ci bot commented Aug 22, 2023

New changes are detected. LGTM label has been removed.

@ammont82 ammont82 merged commit f2bb903 into openshift-assisted:master Aug 22, 2023
7 checks passed
@openshift-ci-robot
Copy link

@ammont82: Jira Issue OCPBUGS-16077 is in an unrecognized state (MODIFIED) and will not be moved to the MODIFIED state.

In response to this:

Related to https://issues.redhat.com/browse/OCPBUGS-16077
Related to https://issues.redhat.com/browse/MGMT-15619

We need to align our regexp for base domain name validations with BE (openshift/assisted-service#5371 (comment)).
New regexps:

const BASE_DOMAIN_REGEX = /^[a-z\d][\-]*[a-z\d]+$/;
const DNS_NAME_REGEX_OCM = /^([a-z\d]([\-]*[a-z\d]+)*\.)+[a-z\d]+[\-]*[a-z\d]+$/;

Before changes:
not-valid-base-domain-name

After changes:
valid-base-domain-name png

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.

rawagner pushed a commit to rawagner/facet-lib that referenced this pull request Sep 13, 2023
* Using same regex for base domain and dns domain that BE

* Add unit tests for validate base domain name
@ammont82 ammont82 deleted the OCPBUGS-16077-problems-regex-base-domain branch December 21, 2023 07:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
jira/severity-critical Referenced Jira bug's severity is critical for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. OCM size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants