Uploaded image for project: 'OpenShift GitOps'
  1. OpenShift GitOps
  2. GITOPS-5909

Argo Rollouts CLI on Konflux: Automate build and update of Rollouts UI in midstream repo

XMLWordPrintable

    • Icon: Story Story
    • Resolution: Unresolved
    • Icon: Undefined Undefined
    • None
    • None
    • Rollouts
    • GitOps Scarlet - Sprint 7/3266

      Story (Required)

      Two parts of this story, A and B.

      A) Create a shell script that will update the sub-module id, build the argo-rollouts-ui, and store it in argo-rollouts-ui-build/(commit id)

      At the moment, in order to build the argo rollouts UI using konflux, we are maintaining a `argo-rollouts-ui-builds/(rollouts commit id)` directory in the 'rh-gitops-midstream/argo-rollouts' repo. This is because Konflux does not support yarn v1, and yarn v1 is used to build the Rollouts UI.

      As a workaround, we are building the argo-rollouts UI and committing the contents of that build to 'argo-rollouts-ui-builds' in the GitHub repository.

      However, we should further automate this process: we should create a shell script that, when run, will build and update the 'argo-rollouts-ui-build/(rollouts commit id)' folder based on the latest submodule commit.

      The shell script should work like this:

      # User runs this:
      hack/update-argo-rollouts-submodule-tag.sh v1.7.2
      # where v1.7.2 is the argo-rollouts repo commit/tag/release that contains the version we want to target
      

      Then the script will do this:

      • 1) Update the 'argo-rollouts' submodule in the root of the repo to the commit specified by the first parameter passed to the script (commands already exist for this in the 'update-argo-rollouts-submodule-tag.sh' script)
      • 2) Erase the contents of the 'argo-rollouts-ui/*' folder of the repo, to ensure it is empty.
      • 3) Perform a new build of argo-rollouts UI, based on the 'argo-rollouts' submodule from step 1
      • 4) Copy the contents of the build from step 3, into 'argo-rollouts-ui/(submodule commit id)'
      • 5) Update the 'Containerfile.plugin' with the new commit id
        • "COPY argo-rollouts-ui-builds/59e5bd385c031600f86075beb9d77620f8d7915e/app argo-rollouts/ui/dist/app" <--- this line
      • 6) Call 'git add' on the new changes

      For this script, we can either modify the existing script in `hack/` or add a new script under `/hack`.

      B) A check to verify that the UI build is up to date

      We can create a shell script that verifies that the commit of the argo-rollouts sub-module matches the commit we've built 'argo-rollouts-ui-builds'. If the two are different, the an exit code of 1 should be returned.

      All the shell script should do is get the git commit of the submodule, and compare that with the(rollouts commit id) value from within the path of ' argo-rollouts-ui-builds/(rollouts commit id)'.

      The shell script should also verify that the containerfile.plugin is up to date with the latest value.

      We can then call that script from github pr check, in order to ensure that when commits are made to the repo, that the 'argo-rollouts-ui-builds' is always in sync with the submodule.

      Acceptance Criteria (Mandatory)

      • New shell script which updates submodule, argo rollouts ui build, and containerfile.plugin
      • New shell script which verifies that the above artifacts are all consistent
      • GitHub action which calls the shell script, and fails if the artifacts are not consistent.

              rh-ee-rnaaz Rizwana Naaz
              jgwest Jonathan West
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated: