Skip to content

Commit 2ccb52f

Browse files
gjsjohnmurraybot
andauthored
Prepare v2.0.0 release (intersystems-community#995)
* revert 48fd477 to reduce vsix size Change is no longer needed because vsce got fixed. * WIP * exclude password from serverForUri API response * update pre-release version number and README * correctly exclude password from serverForUri response * update pre-release version number * Class Documentation Preview was broken in 1.3.2021121601 pre-release * bump pre-release version * Republish pre-release as 1.5.2022011402 to include intersystems-community#827 * updated package-lock.json * Allow serverForUri to return password for unnamed server (intersystems-community#837) * Add CI for prerelease branch * Restrict main CI's 'on release' action to master branch * CI release action must only publish one type of vsix Publish either a pre-release or an ordinary one, depending on whether the release was tagged in the prerelease branch or the master branch. * Prepare 1.5.2022020301 pre-release * auto bump version after pre-release * auto bump version after pre-release * auto bump version after pre-release * Add 1.4.4 changes to prerelease branch (intersystems-community#903) * auto bump version after pre-release * auto bump version after pre-release * auto bump version after pre-release * `npm install` updated package-lock.json * auto bump version after pre-release * Allow `serverForUri` API to return insecure password (intersystems-community#989) * Rework initial connecting to prevent overprompting (intersystems-community#900) * Remove redundant `InputBoxManager` * Use uppercase namespace in `connInfo` * Avoid showing lowercase variant of configured username * Fold api.config.ns to uppercase * Keep statusbar panel text and tip correct * Fix test failure * auto bump version after pre-release * Prepare 2.0.0 release * Remove remaining pre-release entries from CHANGELOG Co-authored-by: ProjectBot <[email protected]>
1 parent 78ee732 commit 2ccb52f

File tree

11 files changed

+365
-180
lines changed

11 files changed

+365
-180
lines changed

.github/workflows/main.yml

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,20 @@ jobs:
2828
strategy:
2929
matrix:
3030
os: [ubuntu-latest, windows-latest, macOS-latest]
31+
outputs:
32+
taggedbranch: ${{ steps.find-branch.outputs.taggedbranch }}
3133
steps:
3234
- uses: actions/checkout@v2
3335
- run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
36+
- name: Find which branch the release tag points at
37+
id: find-branch
38+
if: github.event_name == 'release' && runner.os == 'Linux'
39+
shell: bash
40+
run: |
41+
git fetch --depth=1 origin +refs/heads/*:refs/heads/*
42+
set -x
43+
TAGGEDBRANCH=$(git for-each-ref --points-at=${{github.sha}} --format='%(refname:lstrip=2)' refs/heads/)
44+
echo ::set-output name=taggedbranch::$TAGGEDBRANCH
3445
- name: Set an output
3546
id: set-version
3647
if: runner.os == 'Linux'
@@ -70,7 +81,7 @@ jobs:
7081
run: |
7182
npx vsce package -o ${{ steps.set-version.outputs.name }}.vsix
7283
- uses: actions/upload-artifact@v2
73-
if: runner.os == 'Linux'
84+
if: (runner.os == 'Linux') && (github.event_name != 'release')
7485
with:
7586
name: ${{ steps.set-version.outputs.name }}.vsix
7687
path: ${{ steps.set-version.outputs.name }}.vsix
@@ -125,9 +136,9 @@ jobs:
125136
asset_name: ${{ steps.set-version.outputs.name }}.vsix
126137
asset_content_type: application/zip
127138
publish:
128-
if: github.event_name == 'release'
129-
runs-on: ubuntu-latest
130139
needs: build
140+
if: github.event_name == 'release' && needs.build.outputs.taggedbranch == 'master'
141+
runs-on: ubuntu-latest
131142
steps:
132143
- uses: actions/checkout@v2
133144
with:

.github/workflows/prerelease.yml

Lines changed: 183 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,183 @@
1+
name: CI-prerelease
2+
3+
on:
4+
push:
5+
branches:
6+
- prerelease
7+
paths-ignore:
8+
- "docs/**"
9+
- ".vscode/**"
10+
- ".github/**"
11+
- "*.md"
12+
- "**/*.md"
13+
pull_request:
14+
branches:
15+
- prerelease
16+
release:
17+
types:
18+
- released
19+
jobs:
20+
build:
21+
timeout-minutes: 10
22+
runs-on: ${{ matrix.os }}
23+
strategy:
24+
matrix:
25+
os: [ubuntu-latest, windows-latest, macOS-latest]
26+
outputs:
27+
taggedbranch: ${{ steps.find-branch.outputs.taggedbranch }}
28+
steps:
29+
- uses: actions/checkout@v2
30+
- run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
31+
- name: Find which branch the release tag points at
32+
id: find-branch
33+
if: github.event_name == 'release' && runner.os == 'Linux'
34+
shell: bash
35+
run: |
36+
git fetch --depth=1 origin +refs/heads/*:refs/heads/*
37+
set -x
38+
TAGGEDBRANCH=$(git for-each-ref --points-at=${{github.sha}} --format='%(refname:lstrip=2)' refs/heads/)
39+
echo ::set-output name=taggedbranch::$TAGGEDBRANCH
40+
- name: Set an output
41+
id: set-version
42+
if: runner.os == 'Linux'
43+
run: |
44+
set -x
45+
VERSION=$(jq -r '.version' package.json | cut -d- -f1)
46+
[ $GITHUB_EVENT_NAME == 'release' ] && VERSION=${{ github.event.release.tag_name }} && VERSION=${VERSION/v/}
47+
CHANGELOG=$(cat CHANGELOG.md | sed -n "/## \[${VERSION}\]/,/## /p" | sed '/^$/d;1d;$d')
48+
CHANGELOG="${CHANGELOG//$'\n'/'%0A'}"
49+
echo ::set-output name=changelog::$CHANGELOG
50+
git tag -l | cat
51+
[ $GITHUB_EVENT_NAME == 'push' ] && VERSION+=-beta && VERSION+=.$(($(git tag -l "v$VERSION.*" | sort -nt. -k4 2>/dev/null | tail -1 | cut -d. -f4)+1))
52+
[ $GITHUB_EVENT_NAME == 'pull_request' ] && VERSION+=-dev.${{ github.event.pull_request.number }}
53+
echo ::set-output name=version::$VERSION
54+
NAME=$(jq -r '.name' package.json)-$VERSION
55+
echo ::set-output name=name::$NAME
56+
tmp=$(mktemp)
57+
jq --arg version "$VERSION" '.version = $version' package.json > "$tmp" && mv "$tmp" package.json
58+
mkdir dist
59+
echo $VERSION > .version
60+
echo $NAME > .name
61+
- name: Use Node.js
62+
uses: actions/setup-node@v1
63+
with:
64+
node-version: 14.x
65+
- run: npm install
66+
- name: lint
67+
if: runner.os == 'Linux'
68+
run: npm run lint
69+
- run: npm run compile
70+
- name: npm test
71+
uses: GabrielBB/[email protected]
72+
with:
73+
run: npm run test
74+
- name: Build pre-release package
75+
if: runner.os == 'Linux'
76+
run: |
77+
npx vsce package --pre-release -o ${{ steps.set-version.outputs.name }}.vsix
78+
- uses: actions/upload-artifact@v2
79+
if: (runner.os == 'Linux') && (github.event_name != 'release')
80+
with:
81+
name: ${{ steps.set-version.outputs.name }}.vsix
82+
path: ${{ steps.set-version.outputs.name }}.vsix
83+
- uses: actions/upload-artifact@v2
84+
if: runner.os == 'Linux'
85+
with:
86+
name: meta
87+
path: |
88+
.name
89+
.version
90+
beta:
91+
if: (github.event_name == 'push')
92+
runs-on: ubuntu-latest
93+
needs: build
94+
steps:
95+
- uses: actions/download-artifact@v2
96+
with:
97+
name: meta
98+
path: .
99+
- name: Set an output
100+
id: set-version
101+
if: runner.os == 'Linux'
102+
run: |
103+
set -x
104+
echo ::set-output name=version::`cat .version`
105+
echo ::set-output name=name::`cat .name`
106+
- uses: actions/download-artifact@v2
107+
with:
108+
name: ${{ steps.set-version.outputs.name }}.vsix
109+
- name: Create Pre-Release
110+
id: create_release
111+
uses: actions/create-release@v1
112+
if: runner.os == 'Linux'
113+
env:
114+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
115+
with:
116+
tag_name: v${{ steps.set-version.outputs.version }}
117+
release_name: v${{ steps.set-version.outputs.version }}
118+
prerelease: ${{ github.event_name != 'release' }}
119+
body: |
120+
Changes in this pre-release
121+
${{ steps.set-version.outputs.changelog }}
122+
- name: Upload Pre-Release Asset
123+
id: upload-release-asset
124+
uses: actions/upload-release-asset@v1
125+
if: runner.os == 'Linux'
126+
env:
127+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
128+
with:
129+
upload_url: ${{ steps.create_release.outputs.upload_url }}
130+
asset_path: ${{ steps.set-version.outputs.name }}.vsix
131+
asset_name: ${{ steps.set-version.outputs.name }}.vsix
132+
asset_content_type: application/zip
133+
publish:
134+
needs: build
135+
if: github.event_name == 'release' && needs.build.outputs.taggedbranch == 'prerelease'
136+
runs-on: ubuntu-latest
137+
steps:
138+
- uses: actions/checkout@v2
139+
with:
140+
ref: prerelease
141+
token: ${{ secrets.TOKEN }}
142+
- uses: actions/download-artifact@v2
143+
with:
144+
name: meta
145+
path: .
146+
- name: Use Node.js
147+
uses: actions/setup-node@v1
148+
with:
149+
node-version: 14.x
150+
- name: Prepare pre-release build
151+
id: set-version
152+
run: |
153+
VERSION=`cat .version`
154+
NEXT_VERSION=`cat .version | awk -F. '/[0-9]+\./{$NF++;print}' OFS=.`
155+
echo ::set-output name=name::`cat .name`
156+
tmp=$(mktemp)
157+
git config --global user.name 'ProjectBot'
158+
git config --global user.email '[email protected]'
159+
jq --arg version "${NEXT_VERSION}-SNAPSHOT" '.version = $version' package.json > "$tmp" && mv "$tmp" package.json
160+
git add package.json
161+
git commit -m 'auto bump version after pre-release'
162+
jq --arg version "$VERSION" '.version = $version' package.json > "$tmp" && mv "$tmp" package.json
163+
npm install
164+
jq 'del(.enableProposedApi,.enabledApiProposals)' package.json > "$tmp" && mv "$tmp" package.json
165+
git push
166+
- name: Build pre-release package
167+
run: |
168+
npx vsce package --pre-release -o ${{ steps.set-version.outputs.name }}.vsix
169+
- name: Upload Release Asset
170+
id: upload-release-asset
171+
uses: actions/upload-release-asset@v1
172+
if: runner.os == 'Linux'
173+
env:
174+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
175+
with:
176+
upload_url: ${{ github.event.release.upload_url }}
177+
asset_path: ${{ steps.set-version.outputs.name }}.vsix
178+
asset_name: ${{ steps.set-version.outputs.name }}.vsix
179+
asset_content_type: application/zip
180+
- name: Publish to VSCode Marketplace
181+
run: |
182+
[ -n "${{ secrets.VSCE_TOKEN }}" ] && \
183+
npx vsce publish --pre-release --packagePath ${{ steps.set-version.outputs.name }}.vsix -p ${{ secrets.VSCE_TOKEN }} || true

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Change Log
22

3+
## [2.0.0] 04-Oct-2022
4+
- Enhancements
5+
- Use Server Manager version 3's enhanced security for stored passwords. Explicit permission must be given by the user before Server Manager will provide a connection's stored password to this extension. This feature previewed in the 1.x pre-releases, which 2.0.0 supersedes.
6+
- Add `Copy Invocation` CodeLens alongside `Debug this Method`. Hideable using the `objectscript.debug.copyToClipboard` setting (#974)
7+
- Add `objectscript.importOnSave` setting to control whether saving a client-side file updates code on the connected server. Default is `true` (#985)
8+
39
## [1.8.2] 08-Aug-2022
410
- Enhancements
511
- Support `objectscript` and `objectscript-class` as the info string for [fenced code blocks](https://spec.commonmark.org/0.30/#fenced-code-blocks) when editing Markdown. However coloring does not render in preview (#964)

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
- Server Explorer view (ObjectScript: Explorer) with ability to export items to your working folder.
3636

3737
![ServerExplorer](https://raw.githubusercontent.com/intersystems-community/vscode-objectscript/master/images/explorer.png)
38+
- Integration with with [InterSystems Server Manager](https://marketplace.visualstudio.com/items?itemName=intersystems-community.servermanager) for secure storage of connection passwords.
3839

3940
## Installation
4041

@@ -58,8 +59,8 @@ To unlock these features (optional):
5859

5960
1. Download and install a beta version from GitHub. This is necessary because Marketplace does not allow publication of extensions that use proposed APIs.
6061
- Go to https://github.com/intersystems-community/vscode-objectscript/releases
61-
- Locate the beta immediately above the release you installed from Marketplace. For instance, if you installed `1.8.2`, look for `1.8.3-beta.1`. This will be functionally identical to the Marketplace version apart from being able to use proposed APIs.
62-
- Download the VSIX file (for example `vscode-objectscript-1.8.3-beta.1.vsix`) and install it. One way to install a VSIX is to drag it from your download folder and drop it onto the list of extensions in the Extensions view of VS Code.
62+
- Locate the beta immediately above the release you installed from Marketplace. For instance, if you installed `2.0.0`, look for `2.0.1-beta.1`. This will be functionally identical to the Marketplace version apart from being able to use proposed APIs.
63+
- Download the VSIX file (for example `vscode-objectscript-2.0.1-beta.1.vsix`) and install it. One way to install a VSIX is to drag it from your download folder and drop it onto the list of extensions in the Extensions view of VS Code.
6364

6465
2. From [Command Palette](https://code.visualstudio.com/docs/getstarted/tips-and-tricks#_command-palette) choose `Preferences: Configure Runtime Arguments`.
6566
3. In the argv.json file that opens, add this line (required for both Stable and Insiders versions of VS Code):
@@ -144,7 +145,7 @@ This settings object is useful for both client-side and server-side development.
144145

145146
- Setting the `username` property is optional. If omitted it will be prompted for when connecting, then cached for the session.
146147

147-
- Setting a plaintext value for the `password` property is **not** recommended. Instead, run the `InterSystems Server Manager: Store Password in Keychain` command from Command Palette.
148+
- Setting a plaintext value for the `password` property is **not** recommended. Instead, install the InterSystems Server Manager extension and use that to store your password securely.
148149

149150
- If no password has been set or stored it will be prompted for when connecting, then cached for the session.
150151

package-lock.json

Lines changed: 9 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "vscode-objectscript",
33
"displayName": "InterSystems ObjectScript",
44
"description": "InterSystems ObjectScript language support for Visual Studio Code",
5-
"version": "1.8.3-SNAPSHOT",
5+
"version": "2.0.0-SNAPSHOT",
66
"icon": "images/logo.png",
77
"aiKey": "9cd75d51-697c-406c-a929-2bcf46e97c64",
88
"categories": [
@@ -1446,7 +1446,7 @@
14461446
"devDependencies": {
14471447
"@types/glob": "^7.1.2",
14481448
"@types/mocha": "^7.0.2",
1449-
"@types/node": "^14.0.14",
1449+
"@types/node": "^14.18.0",
14501450
"@types/vscode": "^1.66.0",
14511451
"@types/ws": "^7.2.5",
14521452
"@types/xmldom": "^0.1.29",

src/api/index.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,7 @@ export class AtelierAPI {
188188
serverName = "";
189189
}
190190

191+
const ns = namespace ? namespace.toUpperCase() : conn.ns ? (conn.ns as string).toUpperCase() : undefined;
191192
if (serverName !== "") {
192193
const {
193194
webServer: { scheme, host, port, pathPrefix = "" },
@@ -199,7 +200,7 @@ export class AtelierAPI {
199200
active: this.externalServer || conn.active,
200201
apiVersion: workspaceState.get(this.configName + ":apiVersion", DEFAULT_API_VERSION),
201202
https: scheme === "https",
202-
ns: namespace || conn.ns,
203+
ns,
203204
host,
204205
port,
205206
username,
@@ -216,7 +217,7 @@ export class AtelierAPI {
216217
}
217218
} else {
218219
this._config = conn;
219-
this._config.ns = namespace || conn.ns;
220+
this._config.ns = ns;
220221
this._config.serverName = "";
221222
}
222223
}
@@ -342,14 +343,12 @@ export class AtelierAPI {
342343
authRequestMap.delete(target);
343344
if (this.wsOrFile && !checkingConnection) {
344345
setTimeout(() => {
345-
checkConnection(true, typeof this.wsOrFile === "object" ? this.wsOrFile : undefined);
346-
}, 1000);
346+
checkConnection(password ? true : false, typeof this.wsOrFile === "object" ? this.wsOrFile : undefined);
347+
}, 500);
347348
}
348349
throw { statusCode: response.status, message: response.statusText };
349350
}
350351
await this.updateCookies(response.headers.raw()["set-cookie"] || []);
351-
panel.text = `${this.connInfo}`;
352-
panel.tooltip = `Connected${pathPrefix ? " to " + pathPrefix : ""} as ${username}`;
353352
if (method === "HEAD") {
354353
authRequestMap.delete(target);
355354
return this.cookies;

src/commands/serverActions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ export async function serverActions(): Promise<void> {
7171
const file = currentFile();
7272
const classname = file && file.name.toLowerCase().endsWith(".cls") ? file.name.slice(0, -4) : "";
7373
const classnameEncoded = encodeURIComponent(classname);
74-
const connInfo = `${host}:${port}${pathPrefix}[${nsEncoded}]`;
74+
const connInfo = `${host}:${port}${pathPrefix}[${nsEncoded.toUpperCase()}]`;
7575
const serverUrl = `${https ? "https" : "http"}://${host}:${port}${pathPrefix}`;
7676
const portalPath = `/csp/sys/UtilHome.csp?$NAMESPACE=${nsEncoded}`;
7777
const classRef = `/csp/documatic/%25CSP.Documatic.cls?LIBRARY=${nsEncoded}${

0 commit comments

Comments
 (0)