Skip to content

fix(flake.nix): synchronize playwright version in nix and package.json #16715

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions dogfood/contents/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,8 @@ ENV PATH=$NVM_DIR/versions/node/v$NODE_VERSION/bin:$PATH
RUN npm install -g npm@^10.8
RUN npm install -g pnpm@^9.6

RUN pnpx playwright@1.47.0 install --with-deps chromium

# Ensure PostgreSQL binaries are in the users $PATH.
RUN update-alternatives --install /usr/local/bin/initdb initdb /usr/lib/postgresql/16/bin/initdb 100 && \
update-alternatives --install /usr/local/bin/postgres postgres /usr/lib/postgresql/16/bin/postgres 100
Expand Down
2 changes: 1 addition & 1 deletion dogfood/contents/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ resource "coder_agent" "dev" {
sleep 1
done
cd "${local.repo_dir}" && make clean
cd "${local.repo_dir}/site" && pnpm install && pnpm playwright:install
cd "${local.repo_dir}/site" && pnpm install
EOT
}

Expand Down
12 changes: 11 additions & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@
(pinnedPkgs.golangci-lint)
gopls
gotestsum
hadolint
jq
kubectl
kubectx
Expand Down Expand Up @@ -216,6 +217,14 @@
'';
};
in
# "Keep in mind that you need to use the same version of playwright in your node playwright project as in your nixpkgs, or else playwright will try to use browsers versions that aren't installed!"
# - https://nixos.wiki/wiki/Playwright
assert pkgs.lib.assertMsg
(
(pkgs.lib.importJSON ./site/package.json).devDependencies."@playwright/test"
== pkgs.playwright-driver.version
)
"There is a mismatch between the playwright versions in the ./nix.flake and the ./site/package.json file. Please make sure that they use the exact same version.";
rec {
inherit formatter;

Expand Down Expand Up @@ -261,12 +270,13 @@

uname = "coder";
homeDirectory = "/home/${uname}";
releaseName = version;

drv = devShells.default.overrideAttrs (oldAttrs: {
buildInputs =
(with pkgs; [
coreutils
nix
nix.out
curl.bin # Ensure the actual curl binary is included in the PATH
glibc.bin # Ensure the glibc binaries are included in the PATH
jq.bin
Expand Down
9 changes: 5 additions & 4 deletions nix/docker.nix
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,6 @@ let
experimental-features = nix-command flakes
'';

etcReleaseName = writeTextDir "etc/coderniximage-release" ''
0.0.0
'';

etcPamdSudoFile = writeText "pam-sudo" ''
# Allow root to bypass authentication (optional)
auth sufficient pam_rootok.so
Expand Down Expand Up @@ -115,6 +111,7 @@ let
run ? null,
maxLayers ? 100,
uname ? "nixbld",
releaseName ? "0.0.0",
}:
assert lib.assertMsg (!(drv.drvAttrs.__structuredAttrs or false))
"streamNixShellImage: Does not work with the derivation ${drv.name} because it uses __structuredAttrs";
Expand Down Expand Up @@ -207,6 +204,10 @@ let
'';
};

etcReleaseName = writeTextDir "etc/coderniximage-release" ''
${releaseName}
'';

# https://github.com/NixOS/nix/blob/2.8.0/src/libstore/globals.hh#L464-L465
sandboxBuildDir = "/build";

Expand Down
2 changes: 1 addition & 1 deletion site/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@
"@biomejs/biome": "1.9.4",
"@chromatic-com/storybook": "3.2.2",
"@octokit/types": "12.3.0",
"@playwright/test": "1.47.2",
"@playwright/test": "1.47.0",
"@storybook/addon-actions": "8.5.2",
"@storybook/addon-essentials": "8.4.6",
"@storybook/addon-interactions": "8.5.3",
Expand Down
27 changes: 14 additions & 13 deletions site/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading