Skip to content

[SD-325] GHA for Tide Release#62

Merged
klaukl merged 31 commits intomainfrom
exportconfigpush
Jan 29, 2025
Merged

[SD-325] GHA for Tide Release#62
klaukl merged 31 commits intomainfrom
exportconfigpush

Conversation

@klaukl
Copy link
Contributor

@klaukl klaukl commented Jan 29, 2025

  • Added GHA to support tide release. Mainly changed to be more of an adhoc call on release branch to do config export step. The original one required an automation/branch and then ran config export on it, pushes to a release/branch with naming like release/1.52.0 which has been changed due to JIRA.

  • Create PR GHA is a placeholder and not used yet. Its optional and used to reduce lagoon build / resources because currently: awx sdp-upgrade creates release/branch -> commits platform files / tasks -> opens PR -> config export commit back to release branch (which triggers another lagoon build so 2 going at the same time)
    --> open PR should be skipped for tide and the config export step can open PR after

  • Since we are trying to standardise things and start from JIRA which currently creates a release/SCFA-xxxx after (https://github.com/dpc-sdp/sdp-ansible-upgrade/commit/fa3a91b59b2b7eb1ee3ed51fb1d82e57e6115110) streamline things between ripple/tide release. The AWX template which triggers is sdp-upgrade:
    Note: Haven't replaced the existing config export. Only replace the exist push UAT

- name: Trigger Export Config workflow for Tide projects
      when:
        - project_type == "tide"
      block:
        - name: Trigger Export Config workflow for Tide
          uri:
            url: "https://api.github.com/repos/{{ github_slug }}/actions/workflows/adhoc_config_export.yml/dispatches"
            method: POST
            headers:
              Authorization: "Bearer {{ lookup('env', 'GITHUB_TOKEN') }}"
              Accept: "application/vnd.github.v3+json"
            body_format: json
            body:
              ref: "{{ branch_release }}"
              inputs:
                branch_name: "{{ branch_release }}"
                # uat_push: "{{ update_uat | default(false) | string | lower }}"
                uat_push: "{{ 'true' if update_uat | default('false') else 'false' }}"
            status_code: 
              - 200
              - 204

on:
  workflow_dispatch:
    inputs:
      branch_name:
        description: "Branch name to trigger export config"
        required: true
        type: string
      uat_push:
        description: "Push to UAT flag from template / and origin JIRA"
        required: false
        type: string

jobs:
  export_config_commit:
    name: Trigger Export Config Workflow
    uses: dpc-sdp/github-actions/.github/workflows/rel_export_config.yml@exportconfigpush
    secrets: inherit
    with:
      branch_name: ${{ inputs.branch_name }}

  force_push_to_uat:
    needs: export_config_commit
    if: ${{ inputs.uat_push == 'true' && needs.export_config_commit.result == 'success' }}
    name: Push Branch to UAT
    uses: dpc-sdp/github-actions/.github/workflows/force_push_to_uat.yml@exportconfigpush
    secrets: inherit
    with:
      branch_name: ${{ inputs.branch_name }}```

@klaukl klaukl marked this pull request as ready for review January 29, 2025 22:25
@klaukl klaukl requested a review from dylankelly January 29, 2025 22:26
Copy link
Contributor

@anthony-malkoun anthony-malkoun left a comment

Choose a reason for hiding this comment

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

We've gone through this extensively already Keith so happy to approve.

@klaukl klaukl merged commit 8574cf9 into main Jan 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants