Skip to content

fix: default sdk-ref to main in sync-sdk-compliance workflow - #79

Closed
grdsdev wants to merge 1 commit into
mainfrom
fix/sync-compliance-sdk-ref-default
Closed

grdsdev wants to merge 1 commit into
mainfrom
fix/sync-compliance-sdk-ref-default

Conversation

@grdsdev

@grdsdev grdsdev commented Aug 10, 2026

Copy link
Copy Markdown
Collaborator

The sdk-ref default was pinned to a fixed commit (faba359a, 2026-07-20) when this workflow was added in #65/#66, and has never been refreshed since — it's still that same commit as of current main, weeks and several capability renames (#74) later.

Every caller that doesn't explicitly override sdk-ref diffs the caller's sdk-compliance.yaml against that stale, pre-rename spec, so the sync job resurrects already-renamed/retired capability IDs as spurious "new" not_implemented entries. Hit this in:

This repo has no tags/releases, so there's no signal for anything (Dependabot included) to auto-bump a fixed SHA default here — it would just go stale again on its own schedule. Since this workflow is only ever called by other repos in this org, tracking main by default doesn't carry third-party supply-chain risk; it just keeps the sync correct without ongoing manual upkeep.

Once this merges, the two PRs above should bump their uses: pin to the merge commit and can drop their own sdk-ref: main override, since it'll be the default again.

The default was pinned to a fixed commit (faba359, 2026-07-20) when this
workflow was added and has never been refreshed since — it's still that
same commit as of current main, weeks and several capability renames
(#74) later. Every caller that doesn't explicitly override sdk-ref
diffs against that stale, pre-rename spec, so the sync job resurrects
already-renamed/retired capability IDs as spurious "new" not_implemented
entries (hit supabase-swift#1195 and supabase-flutter#1676).

This repo has no tags/releases, so nothing can auto-bump a fixed SHA
default here either — it would just go stale again. Since this workflow
is only ever called by other repos in this org, tracking main by default
doesn't carry third-party supply-chain risk; it just keeps the sync
correct.
@grdsdev
grdsdev requested review from a team as code owners August 10, 2026 09:06
@coderabbitai

coderabbitai Bot commented Aug 10, 2026 •

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Summary by CodeRabbit

  • Chores
    • Updated SDK compliance synchronization to use the latest SDK changes from the main branch instead of a fixed revision.

Walkthrough

The reusable SDK compliance workflow now uses the main branch by default instead of a pinned SDK commit.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

grdsdev added a commit to supabase/supabase-swift that referenced this pull request Aug 10, 2026
supabase/sdk#79 fixes the reusable workflow's own sdk-ref default (was
stuck on the stale faba359a pin since 2026-07-20). Point at that fix
commit directly and drop our local sdk-ref: main override, since it's
now the workflow's default.

Note: 72fda7c is currently on supabase/sdk's unmerged PR #79. Re-pin to
the actual main commit once that merges.
grdsdev added a commit to supabase/supabase-flutter that referenced this pull request Aug 10, 2026
supabase/sdk#79 fixes the reusable workflow's own sdk-ref default (was
stuck on the stale faba359a pin since 2026-07-20). Point at that fix
commit directly and drop our local sdk-ref: main override, since it's
now the workflow's default.

Note: 72fda7c is currently on supabase/sdk's unmerged PR #79. Re-pin to
the actual main commit once that merges.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/sync-sdk-compliance.yml:
- Line 17: Update the sdk-ref input default in the workflow so it uses a full
immutable commit SHA instead of main, ensuring the _sdk-spec checkout and
sync-compliance execution remain reproducible; retain manual override support if
already provided.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: ede1ab66-dc41-4618-baf9-82e50bbba5f5

📥 Commits

Reviewing files that changed from the base of the PR and between c73e9fa and 72fda7c.

📒 Files selected for processing (1)
  • .github/workflows/sync-sdk-compliance.yml

description: Ref to check out from supabase/sdk for the spec and script
type: string
default: faba359a57d270bbbf68fd6b583db0604ddce8af
default: main

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔒 Security & Privacy | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

workflow=".github/workflows/sync-sdk-compliance.yml"
action=".github/actions/sdk-compliance-check-symbols/action.yml"

rg -n -C 4 \
  'permissions:|pull_request|pull_request_target|workflow_call|actions/checkout|sdk-ref|persist-credentials' \
  "$workflow"

rg -n -C 4 \
  'npm run|working-directory|GITHUB_TOKEN|git' \
  "$action"

Repository: supabase/sdk

Length of output: 1884


🏁 Script executed:

#!/bin/bash
set -euo pipefail

workflow=".github/workflows/sync-sdk-compliance.yml"
action=".github/actions/sdk-compliance-check-symbols/action.yml"

printf '--- workflow ---\n'
cat -n "$workflow"

printf '\n--- action ---\n'
cat -n "$action"

printf '\n--- references to reusable workflow and inputs ---\n'
rg -n -C 4 'sync-sdk-compliance|create-pull-request|push-to-branch|sdk-ref|branch' .github/workflows

Repository: supabase/sdk

Length of output: 241


🏁 Script executed:

#!/bin/bash
set -euo pipefail

workflow=".github/workflows/sync-sdk-compliance.yml"
action=".github/actions/sdk-compliance-check-symbols/action.yml"

printf '%s\n' '--- workflow ---'
cat -n "$workflow"

printf '%s\n' ''
printf '%s\n' '--- action ---'
cat -n "$action"

printf '%s\n' ''
printf '%s\n' '--- references to reusable workflow and inputs ---'
rg -n -C 4 'sync-sdk-compliance|create-pull-request|push-to-branch|sdk-ref|branch' .github/workflows

Repository: supabase/sdk

Length of output: 23246


Pin sdk-ref to an immutable commit.

sdk-ref controls the _sdk-spec checkout, npm ci, and the sync-compliance executable, and this job runs with contents and pull-requests write permissions. main makes workflow-executable code mutable and non-reproducible; pin this input to a full commit SHA, or set strong defaults such as main only with documented manual overrides.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/sync-sdk-compliance.yml at line 17, Update the sdk-ref
input default in the workflow so it uses a full immutable commit SHA instead of
main, ensuring the _sdk-spec checkout and sync-compliance execution remain
reproducible; retain manual override support if already provided.

@QuintinWillison QuintinWillison left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Clearly a move in a better direction, fixing the issue in hand, but it does ask the wider question for me as to whether there might be need for version tags in this repository as is convention for GitHub actions repos - e.g. a major v1.

description: Ref to check out from supabase/sdk for the spec and script
type: string
default: faba359a57d270bbbf68fd6b583db0604ddce8af
default: main

@spydon spydon Aug 10, 2026 •

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.

Since we weren't allowed to have main here (that's what I had initially), I guess that we need to do something like this:

  • Create another job that opens a PR to this repo each week that updates this pin
  • When that PR is merged trigger and action that open PRs that update each separate SDK repo pin
  • And lastly when those PRs are merged, trigger the sync-sdk-compliance jobs for each repo

Quite tedious, but I don't see any other way around it.

@spydon

spydon commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Clearly a move in a better direction, fixing the issue in hand, but it does ask the wider question for me as to whether there might be need for version tags in this repository as is convention for GitHub actions repos - e.g. a major v1.

Since tags are floating it is safer to pin to actual hashes.

@QuintinWillison

Copy link
Copy Markdown
Member

Since tags are floating it is safer to pin to actual hashes.

This is a supabase-org-owned repository, so I think it's safe. Everything upstream (things this repo depends on) are pinned. And yes, of course, the "floating" nature of these tags is precisely why they solve the problem! 😅

@spydon

spydon commented Aug 10, 2026 •

Copy link
Copy Markdown
Contributor

This is a supabase-org-owned repository, so I think it's safe. Everything upstream (things this repo depends on) are pinned. And yes, of course, the "floating" nature of these tags is precisely why they solve the problem! 😅

That was my original thinking about just having this referencing main, but the security team said it didn't matter that it was org-owned and that all checkouts should be pinned.
We wouldn't need tags at all if it didn't matter, since we always want to be up to date with the latest version.

@grdsdev

grdsdev commented Aug 10, 2026

Copy link
Copy Markdown
Collaborator Author

I'm also thinking versioning this repo would solve this, if versioning and pinning SHA commit in the SDK repos, then dependabot will automatically keep them updated using SHA, which solves both issues.

@grdsdev

grdsdev commented Aug 10, 2026

Copy link
Copy Markdown
Collaborator Author

Drafted a tagging setup addressing the thread above: #80 adds release-please, so this repo starts cutting semver tags. Once a first release exists, consumers can pin uses: to a tagged SHA (with the tag as a comment) instead of a raw SHA or @main, and Dependabot's github-actions ecosystem can auto-bump that pin as new tags land — no floating ref, no hand-maintained SHA.

grdsdev added a commit that referenced this pull request Aug 10, 2026
Follow-up to the discussion on #79.

Consumers currently pin `uses:` references to this repo's reusable
workflows (`sync-sdk-compliance.yml`, `validate-sdk-compliance-*.yml`)
either to a raw commit SHA or, in several places, to `@main` directly.
Neither is great:

- A raw SHA has nothing to auto-bump it — this repo has no tags, so
Dependabot's `github-actions` ecosystem has no version signal to key
off, and the SHA just goes stale until someone notices (as happened in
#79).
- `@main` floats. Per the security team's stance in #79's discussion,
that's not acceptable here even though this is an org-owned repo — every
consumer would pick up a change the moment it lands on `main`, without
going through that consumer's own review.

**This PR:** adds
[release-please](https://github.com/googleapis/release-please),
mirroring the setup already used in `supabase-swift` and other SDK repos
(`release-type: simple`, same GitHub-App-token pattern for opening the
release PR). Commit history here already follows Conventional Commits,
so no history rewrite is needed — the first release PR will pick up
whatever merges after this lands.

Once this is in place, consumers can pin like:

```yaml
uses: supabase/sdk/.github/workflows/validate-sdk-compliance-swift.yml@<sha> # v1.2.3
```

and Dependabot bumps that pin automatically as new tags land — no more
hand-maintained SHAs, no floating `main`.

**Not done in this PR** (one-way / repo-admin actions, listed for
whoever merges this):

1. Enable **Immutable actions** in repo settings, so published release
tags can't be retargeted after the fact — this is what actually gives a
tag the same integrity guarantee as a raw SHA (per the [GitHub
docs](https://docs.github.com/en/actions/how-tos/create-and-publish-actions/using-immutable-releases-and-tags-to-manage-your-actions-releases)
linked in #79).
2. Once the first release-please PR merges and tags `v1.0.0`, update
`uses:` lines in `supabase-js`, `supabase-swift`, `supabase-flutter`
(and any other consumers) to pin to that tag's SHA, including the
`@main` references in each repo's `validate-capabilities.yml` — those
weren't part of #79 but have the same problem.
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.

3 participants