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

Add some more validations #2309

Closed
wants to merge 1 commit into from
Closed

Conversation

cjeanner
Copy link
Collaborator

@cjeanner cjeanner commented Sep 4, 2024

Ensure we're consuming projects from the same source.

Copy link
Contributor

openshift-ci bot commented Sep 4, 2024

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

Copy link
Contributor

openshift-ci bot commented Sep 4, 2024

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please ask for approval from cjeanner. For more information see the Kubernetes Code Review Process.

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

@cjeanner cjeanner force-pushed the validations/check-consistency branch from 0791df6 to 435738d Compare September 6, 2024 08:50
# while developping with the Framework.
_projects_src: >-
{{
cifmw_reproducer_default_repositories |
Copy link
Collaborator

Choose a reason for hiding this comment

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

shouldn't we worry about default values for this var here? IIRC it defaults to upstream

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

we need to extend the whole thing. For now, it doesn't check the value, but only the consistency. It's weak, to be fair, and we probably want/need something better here, to ensure we're in the right context.

I don't know if we could get anything from within zuul env showing "where" we run, and create some "validation map" stating something like this:

cifmw_src_base_validation:
  upstream:
    src_base: https://github.com/openstack-k8s-operators
    branch: main
  downstream_trunk:
    src_base: /home/zuul/src/....
    branch: trunk  # whatever it should be
  downstream_18_proposed:
    src_base: https://github.com/openstack-k8s-operators.
    branch: 18.0-proposed  # whatever it should be

That would really consolidate the whole thing. Any thoughts? Of course, it must be extensible in an easy way, to be future proof (new branch, new entry in the mapping).

- name: Assert everything comes from the same source
ansible.builtin.assert:
that:
- _src_name | length == 0
Copy link
Collaborator

Choose a reason for hiding this comment

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

length == 1 , no?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

woops, right.

Ensure we're consuming projects from the same source.
@cjeanner cjeanner force-pushed the validations/check-consistency branch from 435738d to 880931c Compare September 9, 2024 06:19
@cjeanner
Copy link
Collaborator Author

cjeanner commented Sep 9, 2024

IMHO it's a good opportunity to extract the validations in their own role. @lewisdenny you created the initial validations.yml in the reproducer role - any thoughts on extracting them all in a "cifmw_validations" or something like that, with dedicated tasks files maybe?
For the git checks, we could even leverage some deeper inspections with re-usable tasks files, loops and all.

Of course, we'll have to keep some parameters allowing to disable the validations - maybe per "validation groups". We can discuss this and, if you're willing to tackle that, we can do some proper handover :)

@lewisdenny lewisdenny self-assigned this Sep 9, 2024
@lewisdenny
Copy link
Collaborator

IMHO it's a good opportunity to extract the validations in their own role. @lewisdenny you created the initial validations.yml in the reproducer role - any thoughts on extracting them all in a "cifmw_validations" or something like that, with dedicated tasks files maybe? For the git checks, we could even leverage some deeper inspections with re-usable tasks files, loops and all.

Of course, we'll have to keep some parameters allowing to disable the validations - maybe per "validation groups". We can discuss this and, if you're willing to tackle that, we can do some proper handover :)

Yeah it would be nice to support some different types/groups of validations, a role would be best. Let's get a Jira card created and we can flesh it out :)

Copy link

This PR is stale because it has been for over 15 days with no activity.
Remove stale label or comment or this will be closed in 7 days.

@github-actions github-actions bot added the Stale label Oct 22, 2024
@github-actions github-actions bot closed this Oct 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants