Skip to content

ci: Run the Flagsmith SDK behavioural spec - #307

Merged
khvn26 merged 5 commits into
mainfrom
feat/sdk-spec
Oct 21, 2026
Merged

khvn26 merged 5 commits into
mainfrom
feat/sdk-spec

Conversation

@khvn26

@khvn26 khvn26 commented Oct 21, 2026 •

Copy link
Copy Markdown
Member

Runs the Flagsmith SDK behavioural spec against this SDK on every pull request and push to main.

The SDK implements the spec as a short steps file in TypeScript: one function per SDK step, marked with the Gherkin step text as a comment. It doubles as a working usage example of the SDK.

// When the application gets the environment flags
export async function getEnvironmentFlags(flagsmith: Flagsmith) {
    return asSpecFlags(await flagsmith.getEnvironmentFlags());
}
  • sdk-spec/steps.mts: the steps file. It contains only SDK calls and the mapping to the spec's flag shape. The spec's Node.js harness finds the marked functions and runs them for the runner over stdin/stdout, so this repository holds no protocol code.
  • sdk-spec/Dockerfile: builds and packs the SDK from source, installs the tarball, and runs the harness on the steps file. Node.js runs the TypeScript directly, so nothing else is compiled. sdk-spec/ is excluded from the npm package via .npmignore.
  • .github/workflows/sdk-spec.yml: calls the spec's reusable workflow with language: nodejs. The workflow starts a real Flagsmith instance, seeds it through the Admin API and runs the scenarios against the SDK image. It is pinned to v0.3.0.
  • renovate.json: bumps the uses: ref and spec-ref together.

The spec currently covers getting environment flags and getting identity flags with traits.

@khvn26
khvn26 requested a review from a team as a code owner October 21, 2026 10:48
@khvn26
khvn26 requested review from emyller and removed request for a team October 21, 2026 10:48
@khvn26 khvn26 added the hackathon Hackathon work label Oct 21, 2026
@khvn26
khvn26 merged commit 089838b into main Oct 21, 2026
4 checks passed
@khvn26
khvn26 deleted the feat/sdk-spec branch October 21, 2026 15:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hackathon Hackathon work

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants