Compare commits

...

23 Commits

Author SHA1 Message Date
Remy Suen 29879c9c50
Merge pull request #199 from docker/update-release-build-steps
Update the build and documentation around the release process
2025-08-21 09:14:58 -04:00
Remy Suen f8ac9fdddd
Update the build and documentation around the release process
Signed-off-by: Remy Suen <remy.suen@docker.com>
2025-08-21 09:11:03 -04:00
Remy Suen 83879f19b9
Merge pull request #198 from docker/update-language-server-v0.17.0
Update the Docker Language Server to v0.17.0
2025-08-21 08:59:22 -04:00
Remy Suen 3807dd4c7c
Update the Docker Language Server to v0.17.0
Signed-off-by: Remy Suen <remy.suen@docker.com>
2025-08-21 08:54:15 -04:00
Remy Suen dcf0138dc6
Merge pull request #195 from docker/bot/prepare-release-v0.15.0
Prepare for the v0.15.0 release (triggered by rcjsuen)
2025-08-13 12:50:03 -04:00
rcjsuen 3a40496053 Prepare for the v0.15.0 release
This commit was generated by a GitHub Action workflow. It was triggered
by rcjsuen.

Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-08-13 16:48:45 +00:00
Remy Suen bc3c31fde7
Merge pull request #194 from docker/automate-release-process
Refactor the GHA workflows to automate part of the release process
2025-08-13 12:41:18 -04:00
Remy Suen a4e868e155
Apply Prettier fixes
Signed-off-by: Remy Suen <remy.suen@docker.com>
2025-08-13 12:29:37 -04:00
Remy Suen 9df84f7b03
Refactor the GHA workflows to automate part of the release process
The current release process includes many manual steps and has a bit of
back and forth and copying and pasting involved. Automating parts of
this process will help make it easier for new people to make a release
and also avoid small errors leading to the release build failing.

Signed-off-by: Remy Suen <remy.suen@docker.com>
2025-08-13 12:04:24 -04:00
Remy Suen bd38964ec7
Merge pull request #193 from docker/upload-failure-screenshots
Upload test failure screenshots as artifacts
2025-08-13 09:45:21 -04:00
Remy Suen 45f4d187f9
Upload test failure screenshots as artifacts
If the test fails, we should capture the screenshots and upload them as
artifacts to help with debugging.

Signed-off-by: Remy Suen <remy.suen@docker.com>
2025-08-13 09:42:04 -04:00
Remy Suen 4f8ae8fd28
Merge pull request #192 from docker/javascript-format-prettier
Format JavaScript files with Prettier
2025-08-13 09:09:06 -04:00
Remy Suen b26d0fe557
Format JavaScript files with Prettier
Signed-off-by: Remy Suen <remy.suen@docker.com>
2025-08-13 09:04:59 -04:00
Remy Suen 86fcb138e6
Merge pull request #191 from docker/update-language-server-v0.16.0
Update the Docker Language Server to v0.16.0
2025-08-13 08:57:22 -04:00
Remy Suen dbb3458abb
Update the Docker Language Server to v0.16.0
Signed-off-by: Remy Suen <remy.suen@docker.com>
2025-08-13 08:49:05 -04:00
Remy Suen 7af4c38280
Merge pull request #190 from docker/remove-build-workdir
Remove working-directory from the build step
2025-08-12 09:59:35 -04:00
Remy Suen a407622bea
Remove working-directory from the build step
As the build no longer requires checking out the Docker Language
Server's repository either, we should remove the use of the
working-directory attribute to keep the build simple and easy to
understand.

Signed-off-by: Remy Suen <remy.suen@docker.com>
2025-08-12 09:56:14 -04:00
Remy Suen 9bd430f7c0
Merge pull request #189 from docker/prettier-format-json
Use Prettier for formatting JSON files
2025-08-10 16:58:18 -04:00
Remy Suen 797a8f926d
Use Prettier for formatting JSON files
Depending on a user's settings, saving the package.json file may cause
the trailing newline character to be removed. Explicitly setting
Prettier as the formatter for JSON files will ensure formatting stays
consistent and pull requests will not be opened with the trailing
newline character removed by mistake.

Signed-off-by: Remy Suen <remy.suen@docker.com>
2025-08-10 16:26:13 -04:00
Remy Suen d3e079abc8
Merge pull request #188 from docker/update-vscode-extension-tester
Update vscode-extension-tester to use a newer base VS Code
2025-08-08 08:53:39 -04:00
Remy Suen f2c1806ecc
Update vscode-extension-tester to use a newer base VS Code
Signed-off-by: Remy Suen <remy.suen@docker.com>
2025-08-08 07:45:28 -04:00
Remy Suen 85d0539168
Merge pull request #187 from docker/dockerbake-language-configuration
Add language configuration for dockerbake
2025-08-07 09:37:37 -04:00
Remy Suen 721397fbe5
Add language configuration for dockerbake
Added a language configuration to the extension which will improve the
editing experience by colouring brackets, inserting matching brackets,
and more.

Signed-off-by: Remy Suen <remy.suen@docker.com>
2025-08-07 09:30:36 -04:00
14 changed files with 1649 additions and 276 deletions

View File

@ -1,16 +1,22 @@
name: Build
run-name: "Build: ${{ github.event_name != 'workflow_dispatch' && 'Automatic' || 'Release' }}"
on:
push:
branches:
- "**"
- '**'
tags:
- v*
paths-ignore:
- '**/*.md'
pull_request:
branches:
- '**'
paths-ignore:
- '**/*.md'
workflow_dispatch:
jobs:
test-latest:
runs-on: ubuntu-latest
@ -29,11 +35,11 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version: "22.x"
node-version: '22.x'
- uses: actions/setup-go@v5
with:
go-version: "1.23.8"
go-version: '1.23.8'
- run: npm install
working-directory: vscode-extension
@ -52,6 +58,12 @@ jobs:
- run: xvfb-run --auto-servernum --server-args='-screen 0 1920x1080x24' npm test
working-directory: vscode-extension
- uses: actions/upload-artifact@v4
if: failure()
with:
name: screenshots
path: /tmp/test-resources/screenshots/
test-release:
runs-on: ubuntu-latest
@ -60,7 +72,7 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version: "22.x"
node-version: '22.x'
- run: npm install
@ -68,7 +80,14 @@ jobs:
- run: xvfb-run --auto-servernum --server-args='-screen 0 1920x1080x24' npm test
build:
- uses: actions/upload-artifact@v4
if: failure()
with:
name: screenshots
path: /tmp/test-resources/screenshots/
upload:
if: github.event_name != 'workflow_dispatch'
runs-on: ubuntu-latest
needs:
- test-latest
@ -77,42 +96,33 @@ jobs:
strategy:
matrix:
os: [alpine, linux, win32, darwin]
arch: [amd64, arm64]
nodearch: [x64, arm64]
include:
- arch: amd64
nodearch: x64
- arch: arm64
nodearch: arm64
- os: win32
nodeos: win32
ext: .exe
- os: darwin
nodeos: darwin
ext: ""
ext: ''
- os: linux
nodeos: linux
ext: ""
ext: ''
- os: alpine
nodeos: linux
ext: ""
ext: ''
steps:
- name: actions/checkout@v4 (docker/vscode-extension)
uses: actions/checkout@v4
with:
path: vscode-extension
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "22.x"
node-version: '22.x'
- working-directory: vscode-extension
run: |
- run: |
NODE_OS=${{ matrix.nodeos }} NODE_ARCH=${{ matrix.nodearch }} npm install
- name: Set variables
id: set-variables
working-directory: vscode-extension
run: |
VERSION=$(npm pkg get version | tr -d \")
echo "VERSION=$VERSION" >> "$GITHUB_OUTPUT"
@ -120,44 +130,113 @@ jobs:
SHA=$(git rev-parse --short HEAD)
echo "SHA=$SHA" >> "$GITHUB_OUTPUT"
- name: Build the extension (refs/heads)
if: startsWith(github.ref, 'refs/heads')
- name: Build the extension
env:
VERSION: ${{ steps.set-variables.outputs.VERSION }}
SHA: ${{ steps.set-variables.outputs.SHA }}
working-directory: vscode-extension
run: |
npm install -g @vscode/vsce
vsce package --target ${{ matrix.os }}-${{ matrix.nodearch }} -o docker-vscode-extension-${{ matrix.os }}-${{ matrix.nodearch }}-$VERSION-$SHA.vsix
- name: actions/upload-artifact@v4 (refs/heads)
if: startsWith(github.ref, 'refs/heads')
uses: actions/upload-artifact@v4
- uses: actions/upload-artifact@v4
with:
name: docker-vscode-extension-${{ matrix.os }}-${{ matrix.nodearch }}-${{ steps.set-variables.outputs.VERSION }}-${{ steps.set-variables.outputs.SHA }}.vsix
path: vscode-extension/docker-vscode-extension-${{ matrix.os }}-${{ matrix.nodearch }}-${{ steps.set-variables.outputs.VERSION }}-${{ steps.set-variables.outputs.SHA }}.vsix
path: docker-vscode-extension-${{ matrix.os }}-${{ matrix.nodearch }}-${{ steps.set-variables.outputs.VERSION }}-${{ steps.set-variables.outputs.SHA }}.vsix
if-no-files-found: error
- name: Build the extension (refs/tags/v)
if: startsWith(github.ref, 'refs/tags/v')
create-release:
if: github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
needs:
- test-latest
- test-release
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '22.x'
- name: Set variables
id: set-variables
run: |
VERSION=$(npm pkg get version | tr -d \")
echo "VERSION=$VERSION" >> "$GITHUB_OUTPUT"
- name: Generate release notes
run: |
node build/releaser.mjs generate-release-notes > release-notes.tmp
- name: Get current date
id: date
run: echo "current_date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT
- uses: softprops/action-gh-release@c062e08bd532815e2082a85e87e3ef29c3e6d191 # v2.0.8 https://github.com/softprops/action-gh-release/commit/c062e08bd532815e2082a85e87e3ef29c3e6d191
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
name: v${{ steps.set-variables.outputs.version }} - ${{ steps.date.outputs.current_date }}
tag_name: v${{ steps.set-variables.outputs.version }}
body_path: release-notes.tmp
fail_on_unmatched_files: true
upload-release-binaries:
runs-on: ubuntu-latest
needs:
- create-release
strategy:
matrix:
os: [alpine, linux, win32, darwin]
nodearch: [x64, arm64]
include:
- os: win32
nodeos: win32
ext: .exe
- os: darwin
nodeos: darwin
ext: ''
- os: linux
nodeos: linux
ext: ''
- os: alpine
nodeos: linux
ext: ''
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '22.x'
- run: |
NODE_OS=${{ matrix.nodeos }} NODE_ARCH=${{ matrix.nodearch }} npm install
- name: Set variables
id: set-variables
run: |
VERSION=$(npm pkg get version | tr -d \")
echo "VERSION=$VERSION" >> "$GITHUB_OUTPUT"
- name: Build the extension
env:
VERSION: ${{ steps.set-variables.outputs.VERSION }}
working-directory: vscode-extension
run: |
npm install -g @vscode/vsce
vsce package --target ${{ matrix.os }}-${{ matrix.nodearch }} -o docker-vscode-extension-${{ matrix.os }}-${{ matrix.nodearch }}-$VERSION.vsix
- name: actions/upload-artifact@v4 (refs/tags/v)
uses: actions/upload-artifact@v4
if: startsWith(github.ref, 'refs/tags/v')
- uses: actions/upload-artifact@v4
with:
name: docker-vscode-extension-${{ matrix.os }}-${{ matrix.nodearch }}-${{ steps.set-variables.outputs.VERSION }}.vsix
path: vscode-extension/docker-vscode-extension-${{ matrix.os }}-${{ matrix.nodearch }}-${{ steps.set-variables.outputs.VERSION }}.vsix
path: docker-vscode-extension-${{ matrix.os }}-${{ matrix.nodearch }}-${{ steps.set-variables.outputs.VERSION }}.vsix
if-no-files-found: error
- uses: softprops/action-gh-release@c062e08bd532815e2082a85e87e3ef29c3e6d191 # v2.0.8 https://github.com/softprops/action-gh-release/commit/c062e08bd532815e2082a85e87e3ef29c3e6d191
if: startsWith(github.ref, 'refs/tags/v')
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
files: vscode-extension/docker-vscode-extension-${{ matrix.os }}-${{ matrix.nodearch }}-${{ steps.set-variables.outputs.VERSION }}.vsix
tag_name: v${{ steps.set-variables.outputs.version }}
files: docker-vscode-extension-${{ matrix.os }}-${{ matrix.nodearch }}-${{ steps.set-variables.outputs.VERSION }}.vsix
if-no-files-found: error

76
.github/workflows/prepare-release.yml vendored Normal file
View File

@ -0,0 +1,76 @@
name: Prepare release
on:
workflow_dispatch:
inputs:
version_type:
description: Version type
required: true
default: minor
type: choice
options:
- patch
- minor
- major
permissions:
contents: write
pull-requests: write
jobs:
prepare-release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22.x
- name: Update versions in package.json and package-lock.json
id: version
run: |
npm version ${{ github.event.inputs.version_type }} --no-git-tag-version
NEW_VERSION=$(npm pkg get version | tr -d \")
echo "New version (${{ github.event.inputs.version_type }}): $NEW_VERSION"
echo "new_version=$NEW_VERSION" >> $GITHUB_OUTPUT
- name: Update changelog to version ${{ steps.version.outputs.new_version }}
run: |
node build/releaser.mjs update-changelog ${{ steps.version.outputs.new_version }}
- name: Configure Git
run: |
git config --local user.email "${{ github.actor }}@users.noreply.github.com"
git config --local user.name "${{ github.actor }}"
- name: Create pull request
# https://github.com/peter-evans/create-pull-request/releases/tag/v7.0.8
uses: peter-evans/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e
with:
token: ${{ secrets.GITHUB_TOKEN }}
base: main
branch: bot/prepare-release-v${{ steps.version.outputs.new_version }}
commit-message: |
Prepare for the v${{ steps.version.outputs.new_version }} release
This commit was generated by a GitHub Action workflow. It was triggered
by ${{ github.actor }}.
signoff: true
delete-branch: true
title: 'Prepare for the v${{ steps.version.outputs.new_version }} release (triggered by ${{ github.actor }})'
body: |
This pull request was generated by `./github/workflows/prepare-release.yml`.
It modifies the following three files:
- `CHANGELOG.md` (update the section header to ${{ steps.version.outputs.new_version }} with today's date in UTC and the links at the bottom)
- `package.json` (update version number to ${{ steps.version.outputs.new_version }} )
- `package-lock.json` (update version number to ${{ steps.version.outputs.new_version }})
draft: false
add-paths: |
CHANGELOG.md
package.json
package-lock.json
assignees: ${{ github.actor }}
reviewers: ${{ github.actor }}

View File

@ -10,8 +10,4 @@ bin
.test-extensions
syntaxes/
misc/
.github/workflows/build.yml
*/coverage

View File

@ -1,6 +1,12 @@
// Place your settings in this file to overwrite default and user settings.
{
"editor.formatOnSave": true,
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[json]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[typescriptreact]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},

View File

@ -2,6 +2,54 @@
All notable changes to the Docker DX extension will be documented in this file.
## [Unreleased]
### Added
- Dockerfile
- textDocument/inlayHint
- show when an image was last pushed ([docker/docker-language-server#431](https://github.com/docker/docker-language-server/issues/431))
- Compose
- textDocument/completion
- suggest image tags for images from Docker Hub ([docker/docker-language-server#375](https://github.com/docker/docker-language-server/issues/375))
- textDocument/documentLink
- support providing links for the `env_file` attribute of a service object ([docker/docker-language-server#436](https://github.com/docker/docker-language-server/issues/436))
- support providing links for the `env_file` for included paths ([docker/docker-language-server#438](https://github.com/docker/docker-language-server/issues/438))
- Bake
- textDocument/completion
- provide local file and folder name suggestions ([docker/docker-language-server#414](https://github.com/docker/docker-language-server/issues/414))
- `context` attribute in a `target` block
- `contexts` attribute in a `target` block
- `dockerfile` attribute in a `target` block
### Fixed
- Dockerfile
- textDocument/hover
- ignore 4XX errors when hovering over images with a non-standard tag ([docker/docker-language-server#371](https://github.com/docker/docker-language-server/issues/371))
- Compose
- textDocument/completion
- correct file system suggestions if an absolute path is used ([docker/docker-language-server#443](https://github.com/docker/docker-language-server/issues/443))
- textDocument/documentLink
- stop returning links for alias nodes in included paths ([docker/docker-language-server#439](https://github.com/docker/docker-language-server/issues/439))
- Bake
- textDocument/completion
- check the type of the block before suggesting items ([docker/docker-language-server#422](https://github.com/docker/docker-language-server/issues/422))
## [0.15.0] - 2025-08-13
### Added
- added a language configuration for the `dockerbake` language to improve the editing experience ([#184](https://github.com/docker/vscode-extension/issues/184))
- Compose
- updated Compose schema to the latest version
### Fixed
- Bake
- textDocument/hover
- fix error when hovering inside a comment ([docker/docker-language-server#410](https://github.com/docker/docker-language-server/issues/410))
## [0.14.0] - 2025-08-06
### Added
@ -455,7 +503,8 @@ All notable changes to the Docker DX extension will be documented in this file.
- error reporting
- Compose outline support
[Unreleased]: https://github.com/docker/vscode-extension/compare/v0.14.0...main
[Unreleased]: https://github.com/docker/docker-language-server/compare/v0.15.0...main
[0.15.0]: https://github.com/docker/docker-language-server/compare/v0.14.0...v0.15.0
[0.14.0]: https://github.com/docker/vscode-extension/compare/v0.13.0...v0.14.0
[0.13.0]: https://github.com/docker/vscode-extension/compare/v0.12.0...v0.13.0
[0.12.0]: https://github.com/docker/vscode-extension/compare/v0.11.0...v0.12.0

View File

@ -88,6 +88,19 @@ To debug the VS Code extension, clone this repository and then run `npm install`
Run `npm test` to launch the UI tests.
### Releasing
Follow the following steps to create a new release of the Docker DX Visual Studio Code extension:
1. Run the "[prepare release](https://github.com/docker/vscode-extension/actions/workflows/prepare-release.yml)" workflow with the desired bump in semantic versioning. This workflow will update `CHANGELOG.md`, `package.json`, and `package-lock.json` and create a pull request with the three files.
2. Review the generated [pull request](https://github.com/docker/vscode-extension/pulls).
1. The pull request's description will describe the changes to the three files. Verify that the changes make sense.
2. If the changes look good and the builds and checks have completed and passed, approve the pull request and merge it manually.
3. Now that the pull request has been merged into the `main` branch, a build named "Build: Automatic" will be triggered. Wait for the automated build from the "[build](https://github.com/docker/vscode-extension/actions/workflows/build.yml)" workflow to complete.
4. If the build has completed successfully, use the "Run workflow" button to manually trigger the "[build](https://github.com/docker/vscode-extension/actions/workflows/build.yml)" workflow.
5. This manually triggered workflow will start a "Build: Release" which will run the tests, create the release, build the binaries, and attach the binaries to the release.
6. When the workflow has completed, open the [releases](https://github.com/docker/vscode-extension/releases) page. It should have been automatically generated by the workflow and the resulting VSIX files should be attached to the release.
## Telemetry
The Docker DX extension collects telemetry. We collect this telemetry so that we can improve the extension by understanding usage patterns and catching crashes and errors for diagnostic purposes. Note that if you have already opted out of sending telemetry in Visual Studio Code then no telemetry will be sent.

View File

@ -77,7 +77,7 @@ async function downloadLanguageServerBinary() {
const platform = getPlatform();
const arch = getArch();
const suffix = platform === 'windows' ? '.exe' : '';
const version = '0.15.0';
const version = '0.17.0';
const binaryFile = `docker-language-server-${platform}-${arch}-v${version}${suffix}`;
const targetFile = `docker-language-server-${platform}-${arch}${suffix}`;
const url = `https://github.com/docker/docker-language-server/releases/download/v${version}/${binaryFile}`;

170
build/releaser.mjs Normal file
View File

@ -0,0 +1,170 @@
import * as fs from 'fs';
import * as readline from 'readline';
const changelogPath = 'CHANGELOG.md';
const args = process.argv.slice(2);
if (args.length < 1) {
console.error(
`Usage: node releaser.mjs <update-changelog|generate-release-notes> [args...]`,
);
process.exit(1);
}
const command = args[0].toLowerCase();
if (command === 'update-changelog') {
if (args.length < 2) {
console.error(`Usage: node releaser.js update-changelog <version>`);
process.exit(1);
}
const version = args[1];
if (!/^\d+\.\d+\.\d+$/.test(version)) {
console.error(`Error: version must be in format x.y.z (e.g., 1.2.3)`);
process.exit(1);
}
updateChangelog(changelogPath, changelogPath, version)
.then(() =>
console.log(`Successfully updated CHANGELOG.md with version ${version}`),
)
.catch((err) => {
console.error(`Error: ${err.message}`);
process.exit(1);
});
} else if (command === 'generate-release-notes') {
generateReleaseNotes(changelogPath)
.then((content) => console.log(content))
.catch((err) => {
console.error(`Error: ${err.message}`);
process.exit(1);
});
} else {
console.error(
`Error: unknown command '${command}'. Use 'update-changelog' or 'generate-release-notes'`,
);
process.exit(1);
}
function readFileLines(filePath) {
return new Promise((resolve, reject) => {
const lines = [];
const rl = readline.createInterface({
input: fs.createReadStream(filePath),
crlfDelay: Infinity,
});
rl.on('line', (line) => lines.push(line));
rl.on('close', () => resolve(lines));
rl.on('error', reject);
});
}
async function updateChangelog(inputPath, outputPath, newVersion) {
const lines = await readFileLines(inputPath);
let unreleasedIndex = -1;
let nextVersionIndex = -1;
let linksStartIndex = -1;
let previousVersion = '';
for (let i = 0; i < lines.length; i++) {
const line = lines[i];
if (line.includes('## [Unreleased]')) {
unreleasedIndex = i;
} else if (
nextVersionIndex === -1 &&
unreleasedIndex !== -1 &&
line.startsWith('## [') &&
!line.includes('Unreleased')
) {
nextVersionIndex = i;
const match = line.match(/^## \[([0-9]+\.[0-9]+\.[0-9]+)\]/);
if (match) {
previousVersion = match[1];
}
} else if (
linksStartIndex === -1 &&
line.startsWith('[') &&
line.includes(']: https://github.com/')
) {
linksStartIndex = i;
break;
}
}
if (unreleasedIndex === -1) {
throw new Error("could not find 'Unreleased' section in changelog");
}
if (nextVersionIndex === -1 || !previousVersion) {
throw new Error(
"could not find previous version section after 'Unreleased'",
);
}
if (linksStartIndex === -1) {
throw new Error('could not find links section in changelog');
}
const today = new Date().toISOString().split('T')[0];
lines[unreleasedIndex] = `## [${newVersion}] - ${today}`;
const updatedLinks = updateLinks(
lines.slice(linksStartIndex),
newVersion,
previousVersion,
);
const updatedContent = lines.slice(0, linksStartIndex).concat(updatedLinks);
await fs.promises.writeFile(outputPath, updatedContent.join('\n') + '\n');
}
function updateLinks(linkLines, newVersion, previousVersion) {
// first link unreleased, second link with the new tag
const newLinks = [
`[Unreleased]: https://github.com/docker/docker-language-server/compare/v${newVersion}...main`,
`[${newVersion}]: https://github.com/docker/docker-language-server/compare/v${previousVersion}...v${newVersion}`,
];
// all other links can be from the original, after skipping the first one
for (let i = 1; i < linkLines.length; i++) {
newLinks.push(linkLines[i]);
}
return newLinks;
}
async function generateReleaseNotes(filePath) {
const lines = await readFileLines(filePath);
let firstHeader = -1,
secondHeader = -1;
for (let i = 0; i < lines.length; i++) {
if (lines[i].startsWith('## ')) {
if (firstHeader === -1) {
firstHeader = i;
} else if (secondHeader === -1) {
secondHeader = i;
break;
}
}
}
if (secondHeader === -1) {
throw new Error('could not find two ## headers in the changelog');
}
// remove leading and trailing empty newlines
const content = lines.slice(firstHeader + 1, secondHeader);
while (content.length > 0 && content[0].trim() === '') {
content.shift();
}
while (content.length > 0 && content[content.length - 1].trim() === '') {
content.pop();
}
return content.join('\n');
}

View File

@ -0,0 +1,27 @@
{
"comments": {
"blockComment": ["/*", "*/"],
"lineComment": {
"comment": "//",
"noIndent": false
}
},
"brackets": [
["{", "}"],
["[", "]"],
["(", ")"]
],
"autoClosingPairs": [
{ "open": "{", "close": "}" },
{ "open": "[", "close": "]" },
{ "open": "(", "close": ")" },
{ "open": "\"", "close": "\"", "notIn": ["string"] },
{ "open": "/*", "close": " */", "notIn": ["string"] }
],
"surroundingPairs": [
["{", "}"],
["[", "]"],
["(", ")"],
["\"", "\""]
]
}

1297
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -2,7 +2,7 @@
"name": "docker",
"displayName": "Docker DX",
"description": "Edit smarter, ship faster with an enhanced Docker-development experience",
"version": "0.14.0",
"version": "0.15.0",
"icon": "resources/logo-256x256.png",
"license": "Apache-2.0",
"engines": {
@ -21,7 +21,6 @@
"activationEvents": [
"onDebugResolve:dockerfile",
"onDebugDynamicConfigurations:dockerfile",
"onLanguage:dockerbake",
"onLanguage:dockercompose",
"onLanguage:dockerfile"
],
@ -49,7 +48,8 @@
"filenames": [
"docker-bake.hcl",
"docker-bake.override.hcl"
]
],
"configuration": "./configs/dockerbake-language-configuration.json"
}
],
"grammars": [
@ -276,7 +276,7 @@
"ts-loader": "^9.5.1",
"typescript": "^5.4.5",
"umd-compat-loader": "^2.1.2",
"vscode-extension-tester": "^8.13.0",
"vscode-extension-tester": "^8.17.0",
"webpack": "^5.92.1",
"webpack-cli": "^5.1.4"
}

View File

@ -1,64 +0,0 @@
import {
BottomBarPanel,
EditorView,
MarkerType,
ProblemsView,
VSBrowser,
} from 'vscode-extension-tester';
import * as path from 'path';
import { expect } from 'chai';
describe('Docker Bake', function () {
let bottomBar: BottomBarPanel;
before(async function () {
bottomBar = new BottomBarPanel();
await bottomBar.toggle(true);
});
after(async function () {
await bottomBar.toggle(false);
});
describe('Problems', function () {
let view: ProblemsView;
async function problemsExist(view: ProblemsView) {
const markers = await view.getAllVisibleMarkers(MarkerType.Any);
return markers.length > 0;
}
before(async function () {
this.timeout(30000);
view = await bottomBar.openProblemsView();
await VSBrowser.instance.openResources(
path.join('test', 'resources', 'docker-bake.hcl'),
);
await view.getDriver().wait(async function () {
return await problemsExist(view);
}, 15000);
});
after(async function () {
await new EditorView().closeAllEditors();
});
it('Bake file has an error about not being able to find an ARG', async function () {
const errors = await view.getAllVisibleMarkers(MarkerType.Error);
expect(errors.length).equals(1);
const errorText = await errors[0].getText();
expect(errorText).equal(
"Error: 'var' not defined as an ARG in your Dockerfile at line 3 and character 9. generated by Docker DX (docker-language-server)",
);
});
it('Bake file has no warnings', async function () {
const warnings = await view.getAllVisibleMarkers(MarkerType.Warning);
expect(warnings).is.empty;
});
});
});

View File

@ -10,12 +10,21 @@ import * as fs from 'fs';
import * as path from 'path';
import { expect } from 'chai';
describe('Dockerfile', function () {
async function problemsExist(view: ProblemsView) {
const markers = await view.getAllVisibleMarkers(MarkerType.Any);
return markers.length > 0;
}
describe('Problems', function () {
let bottomBar: BottomBarPanel;
let view: ProblemsView;
before(async function () {
this.timeout(30000);
bottomBar = new BottomBarPanel();
await bottomBar.toggle(true);
view = await bottomBar.openProblemsView();
});
after(async function () {
@ -24,18 +33,11 @@ describe('Dockerfile', function () {
describe('Problems', function () {
let editorView: EditorView;
let view: ProblemsView;
async function problemsExist(view: ProblemsView) {
const markers = await view.getAllVisibleMarkers(MarkerType.Any);
return markers.length > 0;
}
before(async function () {
this.timeout(30000);
editorView = new EditorView();
view = await bottomBar.openProblemsView();
const dockerfilePath = path.join('test', 'resources', 'Dockerfile');
fs.writeFileSync(dockerfilePath, 'FROM scratch\nENTRYPOINT ""\n');
@ -92,4 +94,37 @@ describe('Dockerfile', function () {
await editor.save();
});
});
describe('Docker Bake', function () {
before(async function () {
this.timeout(30000);
await VSBrowser.instance.openResources(
path.join('test', 'resources', 'docker-bake.hcl'),
);
await view.getDriver().wait(async function () {
return await problemsExist(view);
}, 15000);
});
after(async function () {
await new EditorView().closeAllEditors();
});
it('Bake file has an error about not being able to find an ARG', async function () {
const errors = await view.getAllVisibleMarkers(MarkerType.Error);
expect(errors.length).equals(1);
const errorText = await errors[0].getText();
expect(errorText).equal(
"Error: 'var' not defined as an ARG in your Dockerfile at line 3 and character 9. generated by Docker DX (docker-language-server)",
);
});
it('Bake file has no warnings', async function () {
const warnings = await view.getAllVisibleMarkers(MarkerType.Warning);
expect(warnings).is.empty;
});
});
});

View File

@ -3,5 +3,6 @@
"git.autoRepositoryDetection": false,
"telemetry.telemetryLevel": "off",
"workbench.editor.enablePreview": false,
"workbench.secondarySideBar.defaultVisibility": "hidden",
"workbench.startupEditor": "none"
}