-
Notifications
You must be signed in to change notification settings - Fork 211
chore(CI): initial step to refactor the CI #3671
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
chore(CI): initial step to refactor the CI #3671
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 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 |
316bf59 to
55d9e3f
Compare
91b31fe to
be8a683
Compare
|
The image is available at: |
|
/review |
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
4bb8f69 to
e6b846e
Compare
|
The image is available at: |
- Create new modular pipeline structure in pipelines/ directory - Add platform abstraction layer (OpenShift, AKS, EKS, GKE) - Implement core utilities (env, k8s, logging, reporting) - Add deployment modules (Helm, PostgreSQL, orchestrator workflows) - Create job handlers for different CI scenarios (pull, nightly, upgrade) - Extract PostgreSQL TLS certificates to temporary directory (security) - Add orchestrator feature flags (INSTALL_ORCHESTRATOR_INFRA/PLUGINS) - Fix code review findings (Qodo analysis): - Fix undefined variable in error message - Replace base64 -w 0 with portable version for macOS - Correct yq path for orchestrator plugin removal - Update .gitignore for pipeline artifacts This refactoring improves code organization, portability, and security while maintaining compatibility with existing CI workflows.
e6b846e to
eb6404d
Compare
|
The image is available at: |
|
@zdrapela Any comments here? |
|
@gustavolira can you please update the description and add a linked issue? 🙏 |
|
Can you please remove the AKS, GKE, and EKS completely? We want to only focus on OCP here for now. Also, remove Can we also set up a job in OpenShift CI that would allow us to verify it runs here? Sorry for the delay, but it still is a scary PR to review 😅 |
zdrapela
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First round of comments. It would be good to do a second round after we have it configured in OpenShift CI
| case "${JOB_NAME}" in | ||
| *pull*ocp*helm*) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not get rid ot this detection by JOB_NAME and move it to openshift/release repo? You already have the Makefile, so let's use it. The entrypoint for ocp-helm pull is here: https://github.com/openshift/release/blob/3951d20775795d07b42e9f10d4df22d61af55182/ci-operator/step-registry/redhat-developer/rhdh/ocp/helm/redhat-developer-rhdh-ocp-helm-commands.sh#L180-L181 and it's similar for others.
|
|
||
| # Detect OpenShift platform (wrapper for common function) | ||
| # Usage: detect_ocp | ||
| detect_ocp() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The detection was not reliable, and it's now hardcoded, see: https://github.com/openshift/release/blob/3951d20775795d07b42e9f10d4df22d61af55182/ci-operator/step-registry/redhat-developer/rhdh/ocp/helm/redhat-developer-rhdh-ocp-helm-commands.sh#L51
Please delete this and the detect_platform_type function
| set -euo pipefail # Exit on error, undefined variables, and pipe failures | ||
|
|
||
| # Source core modules | ||
| # shellcheck source=../../core/k8s.sh |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you tell me what's your ShellCheck config? I cannot get my ShellCheck to follow the sourcing if it wasn't absolute :(
| @@ -0,0 +1,479 @@ | |||
| #!/bin/bash | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove the file
| @@ -0,0 +1,277 @@ | |||
| #!/bin/bash | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove the file
| for file in "${files[@]}"; do | ||
| if [[ -f "${file}" ]]; then | ||
| sed_inplace "s/namespace:.*/namespace: ${project}/g" "${file}" | ||
| fi | ||
| done |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replacing namespace in the files is redundant when you apply the file to a specific namespace instead (which is already happening). What's more, it is making changes in files that you don't want to commit.
| local postgres_password=$(oc get secret/postgress-external-db-pguser-janus-idp \ | ||
| -n "${NAME_SPACE_POSTGRES_DB}" -o jsonpath='{.data.password}') | ||
| sed_inplace "s|POSTGRES_PASSWORD:.*|POSTGRES_PASSWORD: ${postgres_password}|g" \ | ||
| "${resources_dir}/postgres-cred.yaml" | ||
|
|
||
| local postgres_host=$(echo -n "postgress-external-db-primary.${NAME_SPACE_POSTGRES_DB}.svc.cluster.local" | \ | ||
| base64 | tr -d '\n') | ||
| sed_inplace "s|POSTGRES_HOST:.*|POSTGRES_HOST: ${postgres_host}|g" \ | ||
| "${resources_dir}/postgres-cred.yaml" | ||
|
|
||
| oc apply -f "${resources_dir}/postgres-cred.yaml" --namespace="${project}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's use envsubst < file.yaml | oc apply --namespace="${project}" -f - anywhere possible. It's substantially better than using sed
| echo "" | ||
| fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should be notified is secret is not populated. This will hide a missing env var, which is hard to debug
|
This PR is stale because it has been open 7 days with no activity. Remove stale label or comment or this will be closed in 21 days. |
Description
Please explain the changes you made here.
Which issue(s) does this PR fix
PR acceptance criteria
Please make sure that the following steps are complete:
How to test changes / Special notes to the reviewer