Developer Activity: Merge request from feature-branch to main

  1. Navigate to the feature-branch component you had created. If prompted, login as dev1 / {common_password}.

  2. Click on the View Source link to access the git repo of this component.

  3. You will see an alert asking you to create a merge request.

    view merge alert

    If you don’t see this alert, you can access this via the Code → Merge Requests left-hand menu and proceed to click on the New merge request button.
  4. In the New merge request page, create a merge request by clicking on the Create merge request button at the bottom of the page.

    create merge alert

  5. Since this merge request is to the parasol-store component, the parasol-store-build-pr-open pipeline gets triggered and can be viewed in the parasol-store component.

    parasol store pr open pipeline start

  6. Once the pipeline completes, make note of the final task gitlab-update-task, which updates GitLab’s Merge Request with the status of the pipeline.

    parasol store pr open pipeline done

  7. Click on the gitlab-update-task in the Tekton pipeline run.

    gitlab update task Note the POST call to GitLab. Scroll to the right of this request call, and you will note that the POST call sends state=success along with the Commit ID which then marks that particular Merge Request as success.

  8. This status update can be seen in GitLab’s Merge Request page. Note that the Pipeline is marked as Passed and ready to be merged.

    parasol store pr status update

    This handoff between the Tekton pipelines and GitLab is managed using webhooks. . In GitLab, navigate to parasol-store’s Webhooks page to view the Webhooks which have been setup as part of this workshop.

Developer Activity: Merge request from feature-branch to main

In reality, the merge would happen after a peer-review, or a team-lead would review and merge the PR. For the purposes of this workshop, let us go ahead and assume the role of a reviewer.

  1. Navigate back to the Merge Request page and open the request that you created earlier; click on the Merge button.

    parasol store gitlab pr merge

  2. The Merge action triggers another Pipeline in the parasol-store component on Red Hat Developer Hub, which will update the Argo manifests with the new image tag.

    parasol store pr merge start

  3. When this Pipeline is complete, it will:

    1. Update the Dev and Staging Argo CD manifests (deployment YAMLs are updated with the new image tag).

    2. Create a Merge Request against the Production Argo CD manifests.

parasol store pr merge done

Dev and Staging Argo CD Manifest Updates

Let us now see what happened to the Dev and Staging Argo CD manifests updates.

  1. In Red Hat Developer Hub, access the CD tab of the parasol-store component.

    parasol store argo

  2. Click on the outgoing-arrow icon next to parasol-store-dev and parasol-store-staging. Login as (admin / {common_password}).

    This instance of Argo CD/OpenShift GitOps is meant only for applications. The other Argo CD you have accessed thus far is for configuring Red Hat Developer Hub and the platform related Argo CD applications.
  3. You will note that both dev and staging are tagged by the Tekton Pipeline to the same image tag. Hover the pointer over the Last Sync comment as shown in the screenshots below.

    You may need to REFRESH the Argo apps if you don’t see the updates immediately.
    1. Dev Argo CD: parasol-store-dev

      parasol store argo dev

    2. Staging Argo CD: parasol-store-staging

      parasol store argo staging

  4. NOTE: You can click on the parasol-store deploy highlighted to view the deployment YAML of both dev and staging, and you can verify they are both pointing to the same Quay image.

In the next section, you will complete the Production Manifests merge.