Skip to content

ci: Run the Flagsmith SDK behavioural spec - #65

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: one function per SDK step, marked with the Gherkin step text as a comment. It doubles as a working example of the SDK.

// When the application gets the environment flags
pub fn get_environment_flags(flagsmith: &Flagsmith) -> Result<Vec<SpecFlag>, Error> {
    flagsmith.get_environment_flags().map(as_spec_flags)
}
  • sdk-spec/steps.rs: the steps file. sdk-spec/Cargo.toml makes it a small crate depending on the SDK by path, so it can be built, formatted and linted. Neither is published.
  • sdk-spec/Dockerfile: builds the SDK from source on the MSRV toolchain (Rust 1.86) together with the spec's Rust harness, which compiles the steps file in and runs it for the spec over stdin/stdout.
  • .github/workflows/sdk-spec.yml: calls the spec's reusable workflow with language: rust. The workflow starts a real Flagsmith instance, seeds it through the Admin API and runs the scenarios through the steps file. It is pinned to v0.3.0.
  • Cargo.toml: excludes sdk-spec/ from the published package.
  • 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:50
@khvn26
khvn26 requested review from emyller and removed request for a team October 21, 2026 10:50
@coderabbitai

coderabbitai Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: c9adc095-de01-45ef-81a6-5ed31db1987e
📥 Commits

Reviewing files that changed from the base of the PR and between b17f474 and 589d7d7.

📒 Files selected for processing: 6
  • .github/workflows/sdk-spec.yml
  • Cargo.toml
  • sdk-spec/.gitignore
  • sdk-spec/Cargo.toml
  • sdk-spec/Dockerfile
  • sdk-spec/steps.rs

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

📝 Walkthrough

The change adds a Rust harness that creates Flagsmith clients and retrieves environment and identity flags as serialisable values. It adds a multi-stage Docker build for the harness and excludes the harness crate from the root Cargo workspace. A GitHub Actions workflow runs the reusable SDK specification workflow on pull requests and pushes to main. Renovate detects and groups updates to the workflow’s SDK specification version reference.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~15 minutes

Merge Risk: 🟡 Moderate · up to 74717

Merge Risk: 🟡 Moderate · up to 74717

The spec workflow remains dependent on a mutable upstream tag. Pin both references to the same commit before merging unless that CI supply-chain risk is explicitly accepted.

- [ ] Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@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


ℹ️ Review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: ac1f81ee-6f17-42a8-ae11-2c0b65f0e772
📥 Commits

Reviewing files that changed from the base of the PR and between dad8127 and b17f474.

⛔ Files ignored due to path filters: 1
  • spec-adapter/Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing: 7
  • .github/workflows/sdk-spec.yml
  • Cargo.toml
  • renovate.json
  • spec-adapter/.gitignore
  • spec-adapter/Cargo.toml
  • spec-adapter/Dockerfile
  • spec-adapter/src/main.rs

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

Comment thread .github/workflows/sdk-spec.yml Outdated
@khvn26
khvn26 merged commit 9e00b4d into main Oct 21, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants