Remove the SDK version checks from the API sample tests

Open Beginner friendly
#1,436 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 2 days

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
78/100
Issue type
Refactor
Clarity
Clearly specified
Activity status
Active
Tech stack
go, java, javascript, node.js, python

Research direction

Read docs-site/scripts/api-code-samples.integration.test.mjs and docs-site/scripts/api-sdk-support.mjs, then check how the sample tests install and exercise each SDK. Remove the two version equality checks and update the install commands in install-sdk.mdx to use unpinned versions where supported. Done when the tests still run the Node.js samples and the installation instructions no longer require matching audited SDK pins.

Written by the indexing model from the issue text.

Description

needs discussion

Two tests in docs-site/scripts/api-code-samples.integration.test.mjs tie the docs to the SDK versions pinned in sdkVersions in docs-site/scripts/api-sdk-support.mjs:

  • installed Node SDK matches the exact audited version requires the installed @openfga/sdk to equal the pinned js-sdk version. package.json uses a caret range, so any PR that refreshes the lockfile after a js-sdk release installs the new version and fails, even when it doesn't touch the SDK or the samples. Once one of those PRs merges, every PR fails until the pin is bumped. main is in that state now: the lockfile has 0.9.8 and the pin is 0.9.7.
  • native installation instructions name the audited SDK versions requires install-sdk.mdx to install exactly the pinned versions, so the page lags every release. All five are behind right now: js 0.9.7 (latest 0.9.8), go 0.8.2 (0.8.4), dotnet 0.10.4 (0.10.5), python 0.10.4 (0.10.6), java 0.10.0 (0.11.2).

Neither check catches a broken sample. The same file already runs every Node.js sample against the installed SDK.

Runs that failed on the first check since the js-sdk 0.9.8 release:

Proposal: remove both checks, and use unpinned install commands where the package manager allows it (npm, yarn, go get, dotnet add package, pip).

Dominant language
MDX
Stars
52
Forks
110
Avg merge
2d 12h
Merged PRs (30d)
21

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from openfga/openfga.dev

All issues in openfga/openfga.dev

Similar issues

More Documentation issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.