From 7d14468e50996d7851d720ed148b4236743aaa04 Mon Sep 17 00:00:00 2001 From: Max Schmitt Date: Thu, 10 Oct 2024 10:14:23 +0200 Subject: [PATCH] fix: java version fetching logic --- java/docs/ci.mdx | 12 ++++++------ java/docs/docker.mdx | 14 +++++++------- java/docs/intro.mdx | 2 +- java/docs/test-runners.mdx | 4 ++-- src/generate.js | 2 +- 5 files changed, 17 insertions(+), 17 deletions(-) diff --git a/java/docs/ci.mdx b/java/docs/ci.mdx index d20d4ce43a..94dfc3fa02 100644 --- a/java/docs/ci.mdx +++ b/java/docs/ci.mdx @@ -75,7 +75,7 @@ jobs: name: 'Playwright Tests' runs-on: ubuntu-latest container: - image: mcr.microsoft.com/playwright/java:vv1.47.0-noble + image: mcr.microsoft.com/playwright/java:v1.47.0-noble options: --user 1001 steps: - uses: actions/checkout@v4 @@ -165,7 +165,7 @@ trigger: pool: vmImage: ubuntu-latest -container: mcr.microsoft.com/playwright/java:vv1.47.0-noble +container: mcr.microsoft.com/playwright/java:v1.47.0-noble steps: - task: JavaToolInstaller@0 @@ -188,7 +188,7 @@ Running Playwright on CircleCI is very similar to running on GitHub Actions. In executors: pw-noble-development: docker: - - image: mcr.microsoft.com/playwright/java:vv1.47.0-noble + - image: mcr.microsoft.com/playwright/java:v1.47.0-noble ``` Note: When using the docker agent definition, you are specifying the resource class of where playwright runs to the 'medium' tier [here](https://circleci.com/docs/configuration-reference?#docker-execution-environment). The default behavior of Playwright is to set the number of workers to the detected core count (2 in the case of the medium tier). Overriding the number of workers to greater than this number will cause unnecessary timeouts and failures. @@ -199,7 +199,7 @@ Jenkins supports Docker agents for pipelines. Use the [Playwright Docker image]( ```groovy pipeline { - agent { docker { image 'mcr.microsoft.com/playwright/java:vv1.47.0-noble' } } + agent { docker { image 'mcr.microsoft.com/playwright/java:v1.47.0-noble' } } stages { stage('e2e-tests') { steps { @@ -216,7 +216,7 @@ pipeline { Bitbucket Pipelines can use public [Docker images as build environments](https://confluence.atlassian.com/bitbucket/use-docker-images-as-build-environments-792298897.html). To run Playwright tests on Bitbucket, use our public Docker image ([see Dockerfile](./docker.mdx)). ```yml -image: mcr.microsoft.com/playwright/java:vv1.47.0-noble +image: mcr.microsoft.com/playwright/java:v1.47.0-noble ``` ### GitLab CI @@ -229,7 +229,7 @@ stages: tests: stage: test - image: mcr.microsoft.com/playwright/java:vv1.47.0-noble + image: mcr.microsoft.com/playwright/java:v1.47.0-noble script: ... ``` diff --git a/java/docs/docker.mdx b/java/docs/docker.mdx index b54367770d..a01ea2ff0a 100644 --- a/java/docs/docker.mdx +++ b/java/docs/docker.mdx @@ -22,7 +22,7 @@ This Docker image is intended to be used for testing and development purposes on ### Pull the image ```bash -docker pull mcr.microsoft.com/playwright/java:vv1.47.0-noble +docker pull mcr.microsoft.com/playwright/java:v1.47.0-noble ``` ### Run the image @@ -34,7 +34,7 @@ By default, the Docker image will use the `root` user to run the browsers. This On trusted websites, you can avoid creating a separate user and use root for it since you trust the code which will run on the browsers. ```bash -docker run -it --rm --ipc=host mcr.microsoft.com/playwright/java:vv1.47.0-noble /bin/bash +docker run -it --rm --ipc=host mcr.microsoft.com/playwright/java:v1.47.0-noble /bin/bash ``` #### Crawling and scraping @@ -42,7 +42,7 @@ docker run -it --rm --ipc=host mcr.microsoft.com/playwright/java:vv1.47.0-noble On untrusted websites, it's recommended to use a separate user for launching the browsers in combination with the seccomp profile. Inside the container or if you are using the Docker image as a base image you have to use `adduser` for it. ```bash -docker run -it --rm --ipc=host --user pwuser --security-opt seccomp=seccomp_profile.json mcr.microsoft.com/playwright/java:vv1.47.0-noble /bin/bash +docker run -it --rm --ipc=host --user pwuser --security-opt seccomp=seccomp_profile.json mcr.microsoft.com/playwright/java:v1.47.0-noble /bin/bash ``` [`seccomp_profile.json`](https://github.com/microsoft/playwright/blob/main/utils/docker/seccomp_profile.json) is needed to run Chromium with sandbox. This is a [default Docker seccomp profile](https://github.com/docker/engine/blob/d0d99b04cf6e00ed3fc27e81fc3d94e7eda70af3/profiles/seccomp/default.json) with extra user namespace cloning permissions: @@ -75,10 +75,10 @@ See our [Continuous Integration guides](./ci.mdx) for sample configs. See [all available image tags]. We currently publish images with the following tags: -- `:vv1.47.0` - Playwright vv1.47.0 release docker image based on Ubuntu 24.04 LTS (Noble Numbat). -- `:vv1.47.0-noble` - Playwright vv1.47.0 release docker image based on Ubuntu 24.04 LTS (Noble Numbat). -- `:vv1.47.0-jammy` - Playwright vv1.47.0 release docker image based on Ubuntu 22.04 LTS (Jammy Jellyfish). -- `:vv1.47.0-focal` - Playwright vv1.47.0 release docker image based on Ubuntu 20.04 LTS (Focal Fossa). +- `:v1.47.0` - Playwright v1.47.0 release docker image based on Ubuntu 24.04 LTS (Noble Numbat). +- `:v1.47.0-noble` - Playwright v1.47.0 release docker image based on Ubuntu 24.04 LTS (Noble Numbat). +- `:v1.47.0-jammy` - Playwright v1.47.0 release docker image based on Ubuntu 22.04 LTS (Jammy Jellyfish). +- `:v1.47.0-focal` - Playwright v1.47.0 release docker image based on Ubuntu 20.04 LTS (Focal Fossa). :::note diff --git a/java/docs/intro.mdx b/java/docs/intro.mdx index 8d762f6990..86daa0899e 100644 --- a/java/docs/intro.mdx +++ b/java/docs/intro.mdx @@ -58,7 +58,7 @@ public class App { com.microsoft.playwright playwright - v1.47.0 + 1.47.0 diff --git a/java/docs/test-runners.mdx b/java/docs/test-runners.mdx index 1b27d72488..ee010bbc97 100644 --- a/java/docs/test-runners.mdx +++ b/java/docs/test-runners.mdx @@ -198,7 +198,7 @@ repositories { } dependencies { - implementation 'com.microsoft.playwright:playwright:v1.47.0' + implementation 'com.microsoft.playwright:playwright:1.47.0' } application { @@ -231,7 +231,7 @@ repositories { } dependencies { - implementation("com.microsoft.playwright:playwright:v1.47.0") + implementation("com.microsoft.playwright:playwright:1.47.0") } application { diff --git a/src/generate.js b/src/generate.js index 2d7284b55c..495bacda3e 100644 --- a/src/generate.js +++ b/src/generate.js @@ -53,7 +53,7 @@ async function getVersionForLanguageBinding(lang) { case 'java': const githubResponse = await fetch('https://api.github.com/repos/microsoft/playwright-java/releases'); const githubData = await githubResponse.json(); - return githubData[0].tag_name; + return githubData[0].tag_name.substring(1); case 'python': const pypiResponse = await fetch('https://pypi.org/pypi/playwright/json');