Skip to content

[PM-39586] Bump self-host image version and switch to hash pinning#508

Merged
jprusik merged 8 commits into
mainfrom
pm-39586
Jun 30, 2026
Merged

[PM-39586] Bump self-host image version and switch to hash pinning#508
jprusik merged 8 commits into
mainfrom
pm-39586

Conversation

@jprusik

@jprusik jprusik commented Jun 25, 2026

Copy link
Copy Markdown
Collaborator

🎟️ Tracking

PM-39586

Summary

There is a known issue with node-fetch. I fixed it in BIT's shell script for account creation by dropping cross-fetch and using the native node fetch, but the cipher seeding script still fails because it uses the CLI API, and the CLI bundles node-fetch 2.7.0 : https://github.com/bitwarden/clients/blob/main/apps/cli/package.json#L84

But, that's been pinned there for quite some time, and this bad interaction is recent. (a self-host image rewrite happened some time between Jun 25, 4:53 AM EDT (last good BIT run with 2026.6.0 ) and Jun 25, 5:05 AM EDT (the first failure with this error on the rewritten 2026.6.0 image).

Because 2026.6.0 was working, and then broke when 2026.6.1 was tagged, I'm presuming the breaking change came with 2026.6.1 and not 2026.6.0

I was able to get BIT working again by ad-hoc patching node-fetch bundled with the CLI in the test workflows, but local usage will continue to be bugged until addressed either by the server or CLI client

@jprusik jprusik self-assigned this Jun 25, 2026
@jprusik jprusik changed the title [PM-39586] Bump self-host image version [PM-39586] Bump self-host image version and switch to hash pinning Jun 25, 2026
@jprusik jprusik added the ai-review-vnext Request a Claude code review using the vNext workflow label Jun 25, 2026
@jprusik jprusik marked this pull request as ready for review June 25, 2026 20:21
@jprusik jprusik requested review from a team as code owners June 25, 2026 20:21
@jprusik jprusik marked this pull request as draft June 25, 2026 20:21
@github-actions

github-actions Bot commented Jun 25, 2026

Copy link
Copy Markdown

🤖 Bitwarden Claude Code Review

Overall Assessment: APPROVE

Reviewed a test-infrastructure PR that bumps the self-host lite image to 2026.6.1 and switches both image references to digest (hash) pinning, adds a Renovate custom regex manager to keep hash-pinned images current, bumps the @bitwarden/cli to 2026.6.0, and removes the cross-fetch dependency in favor of Node 24's native fetch. It also adds a temporary CI workaround that patches the CLI's bundled node-fetch v2 for the PM-39403 premature-close bug, plus a step that waits for admin DB migrations before seeding.

Code Review Details

No blocking findings.

Notes from analysis (no action required):

  • cross-fetch removal is complete — all three import fetch from "cross-fetch" sites are gone and no references remain; Node 24 provides global fetch (generate-installation.ts already relied on it).
  • The Renovate custom regex matches the final docker-compose.yml digest-plus-comment format for both the lite and mariadb images.
  • The node-fetch sed patch is explicitly marked FIXME/temporary, scoped to CI test tooling, and includes a self-checking guard that warns if the bundled file shape changes — pragmatic for the stated bug.

Dependency Changes

Package Change Ecosystem
cross-fetch Removed npm
@bitwarden/cli 2026.4.1 → 2026.6.0 npm

@jprusik jprusik force-pushed the pm-39586 branch 3 times, most recently from 3504a90 to 9badcc3 Compare June 25, 2026 21:43
@jprusik jprusik marked this pull request as ready for review June 25, 2026 21:44
@jprusik jprusik marked this pull request as draft June 26, 2026 14:40
Comment thread .github/renovate.json
@jprusik jprusik removed the ai-review-vnext Request a Claude code review using the vNext workflow label Jun 26, 2026
@jprusik jprusik force-pushed the pm-39586 branch 8 times, most recently from 51bcb12 to 8a82bb8 Compare June 29, 2026 17:18
@jprusik jprusik force-pushed the pm-39586 branch 4 times, most recently from 7f2a97c to eeedf0e Compare June 29, 2026 20:57
@jprusik jprusik marked this pull request as ready for review June 29, 2026 21:22
@jprusik jprusik added the ai-review-vnext Request a Claude code review using the vNext workflow label Jun 29, 2026
Comment thread scripts/create-account.ts Outdated
@jprusik

jprusik commented Jun 29, 2026

Copy link
Copy Markdown
Collaborator Author

This PR addresses a shared root cause in bitwarden/clients#21431

Comment thread docker-compose.yml
env_file:
- .env
image: ghcr.io/bitwarden/lite:2026.6.0
image: ghcr.io/bitwarden/lite@sha256:01181904fd02020dbc4d0598dd31a153b3784abd8a4d3ac9099fc1a939a58e6e # 2026.6.1

@jprusik jprusik Jun 29, 2026

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

hash pinning since tagged images are not immutable; as things currently stand, this may mean targeted images go away unceremoniously if this falls out of date

Comment thread .github/renovate.json

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

meant to ensure renovate keeps the images up-to-date on the basis of their hash, and not tag

Comment on lines +176 to +184
- name: Wait for admin DB migrations to complete
run: |
echo "Waiting for admin DB migrations..."
timeout 120 sh -c '
until docker compose exec -T bitwarden sh -c "grep -q \"Migration successful\" /etc/bitwarden/logs/admin-*.log 2>/dev/null"; do
sleep 2
done
'
echo "Migrations complete."

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Server returns a success signal before migrations have finished. We previously solved this by retrying account creation over and over; that's still in, but now we wait for a more authoritative success signal. This remains unaddressed for local runs.

@jprusik jprusik added ai-review-vnext Request a Claude code review using the vNext workflow and removed ai-review-vnext Request a Claude code review using the vNext workflow labels Jun 29, 2026

@audreyality audreyality left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

♻️ This PR is taking on a pile of tech debt. I recommend we track that somewhere.

💭 It's very clever to patch node-fetch to work around the premature close.

@jprusik jprusik merged commit f5c8bc0 into main Jun 30, 2026
46 of 48 checks passed
@jprusik jprusik deleted the pm-39586 branch June 30, 2026 18:16
@jprusik jprusik restored the pm-39586 branch July 8, 2026 21:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-review-vnext Request a Claude code review using the vNext workflow

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants