Skip to content

Commit db85f4b

Browse files
Pierre-Gillesclaude
andcommitted
fix(ci): make the build installable by pinning the unreleased SDK
The CI failed at install: `@gladysassistant/integration-sdk@^0.10.0` does not exist on npm — the weather API is still an open pull request (integration-sdk-js#19), so nothing could be installed and no test could run. Pin the dependency to the source archive of that pull request's commit, which makes `npm install`, `npm ci` and the Docker build work today: https://github.com/GladysAssistant/integration-sdk-js/archive/af9d20b....tar.gz An https tarball rather than a `git+https://` dependency on purpose: npm rewrites GitHub git dependencies to `git+ssh://` in the lockfile, which fails on a CI runner with no SSH key. The tarball resolves over plain https, is pinned to an immutable commit, carries an integrity hash and needs no git in the image. With a resolvable dependency there is a lockfile again, so `npm ci` and the npm cache come back in the CI workflow, and the release workflow commits package-lock.json unconditionally. The README says what to revert once the SDK publishes the weather API. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NjFeSaeYevwCQa2KrZ74eZ
1 parent 34caf7e commit db85f4b

5 files changed

Lines changed: 1022 additions & 23 deletions

File tree

.github/workflows/ci.yml

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,10 @@ jobs:
3030
uses: actions/setup-node@v4
3131
with:
3232
node-version: 24
33+
cache: npm
3334

34-
# No `cache: npm` and no `npm ci`: this repository has no committed
35-
# lockfile yet, because the SDK version carrying the weather API
36-
# (`onWeatherGet`, spec B.18) is not published on npm at the time of
37-
# writing — see the note in the README. Once it is, run `npm install`
38-
# once, commit `package-lock.json`, and this step can go back to
39-
# `cache: npm` + `npm ci`.
4035
- name: Install dependencies
41-
run: npm ci --no-audit --no-fund || npm install --no-audit --no-fund
36+
run: npm ci
4237

4338
- name: Check formatting (Prettier)
4439
run: npm run format:check

.github/workflows/release.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,7 @@ jobs:
8585
git config user.name "github-actions[bot]"
8686
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
8787
88-
# package-lock.json is only added when the repository has one (see
89-
# the note in .github/workflows/ci.yml).
90-
git add package.json gladys-assistant-integration.json
91-
[ -f package-lock.json ] && git add package-lock.json || true
88+
git add package.json package-lock.json gladys-assistant-integration.json
9289
git commit -m "chore(release): ${VERSION}"
9390
git tag -a "v${VERSION}" -m "Release ${VERSION}"
9491

README.md

Lines changed: 27 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -101,21 +101,37 @@ provider never sends a field it does not have.
101101
## Requirements
102102

103103
- **Node.js ≥ 20** (uses the built-in global `fetch`; no HTTP dependency).
104-
- **`@gladysassistant/integration-sdk` ≥ 0.10.0** — the version that ships the
105-
weather API (`onWeatherGet`, `WEATHER_CONDITIONS`,
106-
`WEATHER_ALERT_SEVERITIES`, `WEATHER_ALERT_TYPES`).
104+
- **`@gladysassistant/integration-sdk` with the weather API**`onWeatherGet`,
105+
`WEATHER_CONDITIONS`, `WEATHER_ALERT_SEVERITIES`, `WEATHER_ALERT_TYPES`.
107106
- A **Gladys** with weather-integration support (spec B.18); the manifest
108107
declares the range in `gladys_version`.
109108

110-
> **Note — unreleased dependencies.** At the time of writing, both the SDK
111-
> weather API ([integration-sdk-js#19](https://github.com/GladysAssistant/integration-sdk-js/pull/19))
109+
> **⚠️ Temporary: the SDK is pinned to an unreleased commit.**
110+
> The SDK weather API ([integration-sdk-js#19](https://github.com/GladysAssistant/integration-sdk-js/pull/19))
112111
> and the Gladys core support ([Gladys#2738](https://github.com/GladysAssistant/Gladys/pull/2738))
113-
> are open pull requests. `npm install` therefore cannot resolve
114-
> `@gladysassistant/integration-sdk@^0.10.0` yet, and this repository ships no
115-
> `package-lock.json` for that reason. Once the SDK is published: run
116-
> `npm install`, commit the lockfile, adjust `gladys_version` to the Gladys
117-
> release that carries B.18, and put `cache: npm` + `npm ci` back in
118-
> `.github/workflows/ci.yml`.
112+
> are both still open pull requests, so no published npm version carries
113+
> `onWeatherGet` yet. To keep this repository installable and its CI green,
114+
> `package.json` points at the source archive of the **exact commit** of the SDK
115+
> pull request:
116+
>
117+
> ```
118+
> https://github.com/GladysAssistant/integration-sdk-js/archive/af9d20b0e92415c242265c5ee0647f5c618332ec.tar.gz
119+
> ```
120+
>
121+
> An https tarball rather than a `git+…` dependency on purpose: npm rewrites
122+
> GitHub git dependencies to `git+ssh://` in the lockfile, which then fails on
123+
> any CI runner without an SSH key. The tarball resolves over plain https, is
124+
> pinned to an immutable commit, carries an integrity hash and needs no `git`
125+
> in the Docker image.
126+
>
127+
> **When the SDK ships the weather API, do these three things:**
128+
>
129+
> 1. set the dependency back to a plain version (`"^0.10.0"`) and run
130+
> `npm install` to refresh `package-lock.json`;
131+
> 2. set `gladys_version` in the manifest to the Gladys release that carries
132+
> B.18 (it currently guesses `>=4.85.0`);
133+
> 3. re-run `npx github:GladysAssistant/integration-store .` — the store schema
134+
> only accepts `type: "weather"` once Gladys#2738 has landed.
119135
120136
## Run it locally
121137

0 commit comments

Comments
 (0)