Skip to content

Feature/ci azure improvements - #25

Open
fmercadop wants to merge 11 commits into
mainfrom
feature/ci-azure-improvements
Open

Feature/ci azure improvements#25
fmercadop wants to merge 11 commits into
mainfrom
feature/ci-azure-improvements

Conversation

@fmercadop

Copy link
Copy Markdown

What & why

Ports a set of CI/CD improvements that already exist in the equivalent Azure DevOps pipeline for this project into our two GitHub Actions workflows. Keeps our existing two-stage model (PR build → deploy) — the Azure QA/release middle tier is intentionally not ported.

Changes

pull_request_build.yml (PR build stage)

  • Branch validation gate — new validate-branch job: source must start with feature/ or infra/; feature/* may target main or another feature/*, while infra/* may target only main; the source must not be behind main; and infra/* branches may not modify transform/. (Ports Azure's branch_validator.py + infra guard.)
  • Change detection — new detect-changes job skips the dbt job when nothing under transform/ or automate/dbt/ changed; still runs on workflow_dispatch.
  • Clone unchanged incremental/snapshot models from prod before the slim build, to speed up PR builds.
  • Container image bump 3.35.0.

push-to-main.yml (deploy stage)

  • [deploy:full-refresh] marker in the merge commit → appends --full-refresh to both blue/green commands.
  • Deployment version bump + git tag (YYYYMMDD.N.0), committed with [skip ci] and pushed to main. Gated to if: github.event_name == 'push' to avoid double-bumping on merge and to avoid firing on unmerged-PR-close or manual dispatch. Job granted permissions: contents: write.
  • Drop blue/green staging DB on failure as a safety net.
  • Container image bumpsbuild 3.35.0, drop-pr-db-on-close 3.25.0 (previously inconsistent).

⚠️ Required before this works in CI

  1. Branch protection on main must allow the Actions bot to push directly — otherwise the version-bump/tag push fails.
  2. Repo "Workflow permissions" (Settings → Actions → General) must not override the job-level contents: write.

@fmercadop
fmercadop requested a review from noel August 4, 2026 19:59
@fmercadop fmercadop self-assigned this Aug 4, 2026

@noel noel left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

have claude use balboa repo to validate things
you also need to know what all this stuff is doing. not just asking claude to do stuff.

- transform/*
- transform/**/*
- automate/dbt/*
- automate/dbt/**

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I dont think we need both versions * and **
look at this and ask claude
https://github.com/datacoves/balboa/blob/main/.github/workflows/10_feature_dbt_checks.yml#L8

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

It mirrors the existing transform/* + transform/**/* style already in this file so the new paths matched the established convention. But you're right that it's redundant: automate/dbt/** already covers both direct and nested files, so I'll collapse it to a single line.

fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}

- name: Check for dbt-related changes

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I dont know what this is for

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Those two lines just make sure the "what changed?" check is accurate.

fetch-depth: 0 → pull the full git history. The default checkout only grabs the latest commit, and git diff against main needs the shared history to work correctly.
ref: ...head.sha → check out the actual PR branch. By default, on PRs GitHub checks out a temporary "PR merged into main" commit, which would make the diff show main's files too. This points it at the real PR commit so we only see what the PR actually changed.

@@ -0,0 +1,39 @@
#!/bin/bash
set -e

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Are we checking branch names?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

yes, I implemented the feature/* and infra/* branch names. feature can merge into feature or main, and infra can merge only to main. Following what we have in Sevita.

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