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

CI setup: simplify environment passthrough code #16678

Merged

Conversation

edsantiago
Copy link
Member

The passthrough_env function was unnecessarily complicated,
hence fragile. Clean it up, and add regression tests.

For future reference: CI broke horribly because of this.
Rootless tests all failed with missing CI_DESIRED_NETWORK.
Root cause was that CIRRUS_CHANGE_TITLE had a trailing
space which, because of shell indirection, passthrough_env()
wrote as trailing backslash (not backslash-space) in the
/etc/ci_environment file, which then caused the next line
in the file to get glommed onto CIRRUS_CHANGE_TITLE.

[Github-only note: I've added a trailing space to the title of this PR. Github only, not git]

Signed-off-by: Ed Santiago [email protected]

None

@openshift-ci openshift-ci bot added release-note-none approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Nov 29, 2022
@edsantiago
Copy link
Member Author

@cevich PTAL.

Copy link
Member

@cevich cevich left a comment

Choose a reason for hiding this comment

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

Minor thing: I'd like the test script to actually be run in CI.

contrib/cirrus/lib.sh Outdated Show resolved Hide resolved
contrib/cirrus/lib.sh Show resolved Hide resolved
contrib/cirrus/lib.sh Show resolved Hide resolved
contrib/cirrus/lib.sh Show resolved Hide resolved
contrib/cirrus/lib.sh.t Show resolved Hide resolved
@edsantiago edsantiago force-pushed the simplify_passthrough_env branch from 45bb972 to fe62b37 Compare December 1, 2022 20:05
The passthrough_env function was unnecessarily complicated,
hence fragile. Clean it up, and add regression tests.

For future reference: CI broke horribly because of this.
Rootless tests all failed with missing CI_DESIRED_NETWORK.
Root cause was that CIRRUS_CHANGE_TITLE had a trailing
space which, because of shell indirection, passthrough_env()
wrote as trailing backslash (not backslash-space) in the
/etc/ci_environment file, which then caused the next line
in the file to get glommed onto CIRRUS_CHANGE_TITLE.

Signed-off-by: Ed Santiago <[email protected]>
@edsantiago edsantiago force-pushed the simplify_passthrough_env branch from fe62b37 to bdd5f82 Compare December 1, 2022 23:19
@edsantiago
Copy link
Member Author

checks already in contrib/cirrus/prebuild.sh

So done. Thanks for letting me know the right place.


# Combine into one
PASSTHROUGH_ENV_RE="(^($PASSTHROUGH_ENV_EXACT)\$)|(^($PASSTHROUGH_ENV_ATSTART))|($PASSTHROUGH_ENV_ANYWHERE)"

Copy link
Member

Choose a reason for hiding this comment

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

Really great, and easy to read/understand.

Copy link
Member

@cevich cevich left a comment

Choose a reason for hiding this comment

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

LGTM Thanks for taking this on Ed.

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Dec 2, 2022

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: cevich, edsantiago

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

@rhatdan
Copy link
Member

rhatdan commented Dec 3, 2022

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Dec 3, 2022
@openshift-merge-robot openshift-merge-robot merged commit ca6ae5c into containers:main Dec 3, 2022
@edsantiago edsantiago deleted the simplify_passthrough_env branch December 4, 2022 03:03
@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 19, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 19, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. release-note-none
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants