Skip to content

add CI validation for server dependency version#933

Open
chaptersix wants to merge 5 commits intotemporalio:mainfrom
chaptersix:alex/validate-server-version
Open

add CI validation for server dependency version#933
chaptersix wants to merge 5 commits intotemporalio:mainfrom
chaptersix:alex/validate-server-version

Conversation

@chaptersix
Copy link
Contributor

@chaptersix chaptersix commented Feb 4, 2026

Summary

  • Adds a new CI job that validates the go.temporal.io/server dependency
  • Ensures the dependency is a tagged version (not a pseudo-version with commit hash)
  • Ensures the version doesn't exceed the next server release (major.minor+1 from latest GitHub release)

Test plan

  • CI job runs successfully on this PR
  • Verify validation passes for current v1.30.0-148.4 (latest release is v1.29.2)

Adds a new CI job that validates the go.temporal.io/server dependency:
- Ensures it's a tagged version (not a pseudo-version with commit hash)
- Ensures it doesn't exceed the next server release (major.minor+1 from latest)

Uses actions/github-script to fetch the latest release from temporalio/temporal
and compare versions using semver.
@chaptersix chaptersix requested review from a team as code owners February 4, 2026 13:17
@chaptersix chaptersix changed the title feat: add CI validation for server dependency version add CI validation for server dependency version Feb 4, 2026
@chaptersix chaptersix requested a review from bergundy February 4, 2026 13:46
- name: Validate server dependency version
uses: actions/github-script@v7
with:
script: |
Copy link
Member

Choose a reason for hiding this comment

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

Will defer to CLI team, but IMO any build tooling/validation like this should be written like any other software that anyone can run at any time (in these cases in other repositories, we've often made Go commands somewhere under internal only for use as build tooling). But up to y'all.

Copy link
Member

Choose a reason for hiding this comment

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

I don't think it needs to be a Go command because I don't see much motivation for running this outside of CI.
I would accept any modern programming language, just not shell. JS is fine in this case but it would be great if we could put the script in its own file to get proper syntax highlighting.

Copy link
Member

@cretz cretz Feb 4, 2026

Choose a reason for hiding this comment

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

I don't see much motivation for running this outside of CI

Even without much motivation, why not? It doesn't add anything, is not meaningfully more difficult, and is a clearer way to write software. I think you'll find as this script and the pattern in general grows, the unwieldiness of this approach will become apparent, might as well do it right while it doesn't cost anything.

JS is fine

This cannot be run in a traditional JS runtime as is, it's "github-script" which has a bunch of special runtime affordances. I too think traditional JS approach would be good as opposed to GH-runtime-specific.

to get proper syntax highlighting.

Arguably if you can give up type checking, you can give up syntax highlighting.


// Parse major.minor from a version string like "v1.30.0-148.4" or "v1.29.2"
function parseMajorMinor(version) {
const match = version.match(/^v?(\d+)\.(\d+)/);
Copy link
Member

Choose a reason for hiding this comment

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

I don't think the v is optional.

Suggested change
const match = version.match(/^v?(\d+)\.(\d+)/);
const match = version.match(/^v(\d+)\.(\d+)/);


// 1. Read and parse go.mod
const goModContent = fs.readFileSync('go.mod', 'utf-8');
const serverVersionMatch = goModContent.match(new RegExp(`${SERVER_MODULE.replace(/\//g, '\\/')}\\s+(v[^\\s]+)`));
Copy link
Member

Choose a reason for hiding this comment

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

You should be able to use RegExp.escape here.

actions: write

jobs:
validate-server-version:
Copy link
Member

Choose a reason for hiding this comment

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

This should only run on merge to main.

core.info('✓ Version is a valid tagged version');

// 3. Fetch latest release from GitHub
const { data: release } = await github.rest.repos.getLatestRelease({
Copy link
Member

Choose a reason for hiding this comment

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

Make sure you use an API key here to avoid getting throttled by GH.

Adds a Go tool that validates the go.temporal.io/server dependency:
- Ensures it's a tagged version (not a pseudo-version)
- Ensures it doesn't exceed one minor version ahead of the latest
  temporalio/temporal GitHub release

Runs on push to main and PRs targeting main.
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