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

NO-JIRA: feat: add gatherer name validation to gendocs #1075

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

opokornyy
Copy link
Contributor

This commit adds validation for gatherer names to validate that they follow the naming convention.

This PR adds validation for gatherer names to validate that they follow the naming convention.

Categories

  • Bugfix
  • Data Enhancement
  • Feature
  • Backporting
  • Others (CI, Infrastructure, Documentation)

Sample Archive

None

Documentation

None

Unit Tests

None

Privacy

Yes. There are no sensitive data in the newly collected information.

Changelog

Breaking Changes

No

References

This is the PR that introduced the naming convention to openshift API for our CRDs (DataGather, InsightsDataGather)
openshift/api#2200

This commit adds validation for gatherer names to validate
that they follow the naming convention.

Signed-off-by: Ondrej Pokorny <[email protected]>
@openshift-ci openshift-ci bot requested review from ncaak and tremes February 26, 2025 13:02
@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 26, 2025
reSampleArchive = regexp.MustCompile(`docs/(insights-archive-sample/.*)`)
reGathererName = regexp.MustCompile("(?m)^###\\s*Config ID\\s*\\n`([^`]*)`")
reGathererNameValidation = regexp.MustCompile("^[a-z]+[_a-z]*[a-z]([/a-z][_a-z]*)?[a-z]$")
gathererNameExceptions = []string{"ContainersLogs"}
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, it has different structure and the regex does not match the gatherer name, because there is none.

Copy link
Contributor

Choose a reason for hiding this comment

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

Perhaps we should add some name...I would rather avoid this kind of exceptions, because then it means it can't be disabled in the API right

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If it possible to add the name then let's do that

@opokornyy opokornyy requested a review from tremes March 3, 2025 07:41
@opokornyy opokornyy force-pushed the gatherer-name-validator branch from 3c695ef to 67d6e16 Compare March 3, 2025 08:06
@opokornyy
Copy link
Contributor Author

/retest

1 similar comment
@opokornyy
Copy link
Contributor Author

/retest

Copy link

openshift-ci bot commented Mar 11, 2025

@opokornyy: all tests passed!

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.

Copy link
Contributor

@ncaak ncaak 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 Mar 14, 2025
Copy link

openshift-ci bot commented Mar 14, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ncaak, opokornyy

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

@opokornyy opokornyy changed the title feat: add gatherer name validation to gendocs NO-JIRA: feat: add gatherer name validation to gendocs Mar 14, 2025
@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Mar 14, 2025
@openshift-ci-robot
Copy link
Contributor

@opokornyy: This pull request explicitly references no jira issue.

In response to this:

This commit adds validation for gatherer names to validate that they follow the naming convention.

This PR adds validation for gatherer names to validate that they follow the naming convention.

Categories

  • Bugfix
  • Data Enhancement
  • Feature
  • Backporting
  • Others (CI, Infrastructure, Documentation)

Sample Archive

None

Documentation

None

Unit Tests

None

Privacy

Yes. There are no sensitive data in the newly collected information.

Changelog

Breaking Changes

No

References

This is the PR that introduced the naming convention to openshift API for our CRDs (DataGather, InsightsDataGather)
openshift/api#2200

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.

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. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants