Open carlmes opened 3 days ago
The goal of this is to provide a simple reminder to the user that they should be reverting those when they open a PR.
The script uses GitHub Actions annotation format to automatically annotate the line with the issue:
I think that there is still an opportunity to enhance the bootstrap process to automatically set some of these values when users are forking/branching.
For the env variable piece, the vars
feature in kustomize that the linked article in # 2 uses is a depreciated feature that has been replaced with replacements
The Git repository locations are currently hard coded into the source yaml. This means that when contributing updates to this repo, either through a branch or a forked repository, the manual repo locations must be changed for testing, and then reverted prior to PR merging. Here's an example of this in a recent pull request:
To compound the problem, we now have multiple yaml files containing the comment "Update me on fork" with a hard coded URL, for example all the files in the cluster/overlays contain this logic with a hard coded Git repo location:
Potential Enhancement #1
Use Kustomize environment variables so that there is a single location for the Git repository URL and branch name, this removes the requirement for multiple repository locations in multiple files to be updated during testing on a forked repository. It will also make it a lot easier to use this project in a disconnected environment, where GitHub is potentially unreachable and an alternate internal Git repo is used instead.
Steps to implement:
Potential Enhancement #2
To solve the problem of merge requests containing accidental "TODO Change back when ready to merge" comments, we could make these Kustomize environment variables dynamically generated during the execution of
bootstrap.sh
.It's suggested that the current Git repo (
git remote -v
) and branch (git branch
) are dynamically added to a Kustomize environment file, such asenvironment-properties.env
. To ensure that the user is aware of the Git repo and branch in use, the bootstrap script should be enhanced with a prompt such as:Where the defaults in the prompt are the Git remote origin and branch from the directory where the bootstrap script is being run.
Steps to implement:
.gitignore
since it will be dynamically generatedPotential Enhancement #3
Another option is to use Git actions to verify and/or update the manually defined Git repo locations in the various YAML files. This has the advantage of keeping the code looking a little cleaner (no environment to worry about), but will require a little more maintenance in the long run to keep the list of files and locations up to date.