Skip to content
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

Trigger azure-pipelines.yml via GitHub Action #294

Closed
Tracked by #295
thekaveman opened this issue Aug 16, 2023 · 7 comments
Closed
Tracked by #295

Trigger azure-pipelines.yml via GitHub Action #294

thekaveman opened this issue Aug 16, 2023 · 7 comments
Labels
actions Related to GitHub Actions workflows infrastructure Terraform, Azure, etc.

Comments

@thekaveman
Copy link
Member

thekaveman commented Aug 16, 2023

This has some overlap with #284 and so will need to coordinate, possibly building on top of the work done there.

A single GitHub repository can be associated with multiple Azure DevOps organizations/projects:

Once the GitHub App is installed, pipelines can be created for the organization's repositories in different Azure DevOps organizations and projects.

From Azure docs: Build GitHub repositories.

But the docs go on to say (emphasis mine):

However, if you create pipelines for a single repository in multiple Azure DevOps organizations, only the first organization's pipelines can be automatically triggered by GitHub commits or pull requests. Manual or scheduled builds are still possible in secondary Azure DevOps organizations.

So in order to deploy to multiple Azure DevOps orgs (i.e. MST and SBMTD), we're going to need to trigger the azure-pipelines.yml run manually, via GitHub Actions.

Further, (if possible) it would make sense to trigger every org's pipeline in the same way, e.g. not have one of the DevOps orgs setup for "automatic trigger by GitHub commits or pull requests" like mentioned in the docs above. Each org should deploy via the GitHub Action.

Note manually here does not mean literally a human clicking a button to trigger a workflow. It means we'll need a GitHub Actions workflow (that acts on e.g. tag, to accommodate what is needed for #284) that then triggers the pipeline.

@thekaveman thekaveman added actions Related to GitHub Actions workflows infrastructure Terraform, Azure, etc. labels Aug 16, 2023
@thekaveman thekaveman added this to the SBMTD milestone Aug 16, 2023
@thekaveman thekaveman moved this from Todo to Stretch in Digital Services Sep 18, 2023
@thekaveman thekaveman moved this from Stretch to Todo in Digital Services Sep 18, 2023
@angela-tran
Copy link
Member

angela-tran commented Sep 26, 2023

This task may not be necessary based on some findings from my experiments documented in #284 (comment)

I noticed that my commits to ... branch [#307] were triggering both the real MST DevOps pipeline as well as another DevOps pipeline I created in our separate compilerllc organization. This doesn't match the documentation that Kegan linked to in #294 which says that only the "first" organization's pipeline will be triggered by commits or pull requests.

@angela-tran
Copy link
Member

Once #346 is merged in, I suggest that as our next step we set up an Azure DevOps pipeline in SBMTD's organization and see if GitHub commits / pull requests automatically trigger in both MST and SBMTD or just one. That will help us decide if we need to do this ticket or not.

@angela-tran
Copy link
Member

angela-tran commented Oct 24, 2023

I ran several experiments to help us decide if we need to do this ticket or not. In my first experiment, I made a test commit - 750d85f - on the feat/sbmtd-infra-pipeline branch. In my second experiment, I opened #352. Both experiments resulted in only triggering the MST pipeline.

This behavior matches what the Azure docs say.

I'm not sure what difference was causing the behavior described in #294 (comment). You can see that both MST and Compiler LLC pipelines were being triggered if you notice that the Azure pipelines link in #307 goes to mstransit (though the build unfortunately no longer exists) and that there is a corresponding build in Compiler LLC.

But anyways, the point is that our current configuration behaves such that we need to do this ticket. 👍

@angela-tran angela-tran self-assigned this Oct 24, 2023
@angela-tran angela-tran moved this from Todo to In Progress in Digital Services Oct 24, 2023
@angela-tran
Copy link
Member

Today we tried out merging #349 into dev, and it triggered a pipeline run in each organization

@thekaveman
Copy link
Member Author

thekaveman commented Oct 31, 2023

The pipelines do run in each org when a PR is merged against our deploy branches dev, test, prod 👍

However we only get the plan run for a PR being opened against the deploy branches for the first org (MST). Hence we'll still need an action workflow to at least trigger the plan.

@thekaveman thekaveman moved this from In Progress to Paused in Digital Services Nov 1, 2023
@thekaveman
Copy link
Member Author

Pausing for now -- we can apply changes to multiple orgs, which was the main goal.

As we make more progress on #282 our thinking / procedure here may change.

@thekaveman thekaveman removed this from the SBMTD Mobility Pass milestone Nov 13, 2023
@thekaveman
Copy link
Member Author

This doesn't feel like it is worth the effort at this time, as the deployments for MST and SBMTD are currently working. We do not have any plans to expand Eligibility Server to additional agencies.

@thekaveman thekaveman closed this as not planned Won't fix, can't repro, duplicate, stale Aug 8, 2024
@github-project-automation github-project-automation bot moved this from Paused to Done in Digital Services Aug 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
actions Related to GitHub Actions workflows infrastructure Terraform, Azure, etc.
Projects
Archived in project
Development

No branches or pull requests

2 participants