diff --git a/.github/workflows/draft-release.yaml b/.github/workflows/draft-release.yaml index 6c9e46c5d..d7e3ea565 100644 --- a/.github/workflows/draft-release.yaml +++ b/.github/workflows/draft-release.yaml @@ -47,7 +47,7 @@ jobs: PREV_VERSION_TAG=$(gh api repos/:owner/:repo/releases --jq '. | map(select(.draft == false)) | .[0] | .tag_name') PREV_VERSION=$(npx semver --coerce ${PREV_VERSION_TAG}) - NEXT_VERSION=$(npx semver -i $VERSION_INPUT $PREV_VERSION) + NEXT_VERSION=$(npx semver -i $VERSION_BUMP $PREV_VERSION) else NEXT_VERSION=${{ github.event.inputs.exactVersion }} fi @@ -59,13 +59,11 @@ jobs: npx semver v"${NEXT_VERSION}" npm version "${NEXT_VERSION}" --no-git-tag-version - echo "RELEASE_TAG=v${NEXT_VERSION}" >> $GITHUB_ENV + echo "RELEASE_TAG=v${NEXT_VERSION}" >> "$GITHUB_ENV" - name: Validate release tag shell: bash run: | - RELEASE_TAG=${{ inputs.RELEASE_TAG }} - if [ -z "${RELEASE_TAG}" ]; then echo "RELEASE_TAG is not set or is empty" exit 1 @@ -98,7 +96,7 @@ jobs: ls *.vsix.sig gh release create "${RELEASE_TAG}" \ - --title "${RELEASE_VERSION}" \ + --title "${RELEASE_TAG}" \ --notes "Edit the release notes before publishing." \ --target main \ --draft \ diff --git a/CHANGELOG.md b/CHANGELOG.md index e6e884d7a..cd72036a9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Change Log +## [v1.4.0](https://github.com/mongodb-js/vscode/releases/tag/untagged-cda8b18ef8ec5f1910ea) - null + +Edit the release notes before publishing. + + ## [v1.3.1](https://github.com/mongodb-js/vscode/releases/tag/v1.3.1) - 2023-10-09 ## What's Changed @@ -425,17 +430,3 @@ To dig deeper please feel free to follow the links mentioned below: - Connections in the tree view are now alphabetically sorted -## [v0.0.3](https://github.com/mongodb-js/vscode/releases/tag/v0.0.3) - 2020-05-26 - -### Added - -- Added `require` support in playgrounds - -### Fixed - -- Fixed an issue with file pathing on SSL and SSH connections on windows -- Fixed an issue with connecting to mongodb through the shell while using SSH -- Fixed a connectivity issue with playgrounds and SSH connections -- Fixed an issue with having a babel config in a workspace root - - diff --git a/src/test/suite/connectionController.test.ts b/src/test/suite/connectionController.test.ts index abd4639ae..7845d1417 100644 --- a/src/test/suite/connectionController.test.ts +++ b/src/test/suite/connectionController.test.ts @@ -32,6 +32,9 @@ import { } from './dbTestHelper'; import type { LoadedConnection } from '../../storage/connectionStorage'; +// eslint-disable-next-line @typescript-eslint/no-var-requires +const { version } = require('../../../package.json'); + const testDatabaseConnectionName = 'localhost:27088'; const testDatabaseURI2WithTimeout = 'mongodb://shouldfail?connectTimeoutMS=1000&serverSelectionTimeoutMS=1000'; @@ -245,8 +248,7 @@ suite('Connection Controller Test Suite', function () { }); test('the connection model loads both global and workspace stored connection models', async () => { - const expectedDriverUrl = - 'mongodb://localhost:27088/?appname=mongodb-vscode+0.0.0-dev.0'; + const expectedDriverUrl = `mongodb://localhost:27088/?appname=mongodb-vscode+${version}`; await vscode.workspace .getConfiguration('mdb.connectionSaving') @@ -850,7 +852,7 @@ suite('Connection Controller Test Suite', function () { ); assert.strictEqual( connections[0].connectionOptions?.connectionString.includes( - 'appname=mongodb-vscode+0.0.0-dev.0' + `appname=mongodb-vscode+${version}` ), true ); @@ -894,8 +896,7 @@ suite('Connection Controller Test Suite', function () { assert.deepStrictEqual(connectionInfo, { id: 'c4871b21-92c4-40e2-a2c2-fdd551cff114', connectionOptions: { - connectionString: - 'mongodb+srv://username:somepassword@host.u88dd.test.test/?authSource=admin&readPreference=primary&appname=mongodb-vscode+0.0.0-dev.0&ssl=true', + connectionString: `mongodb+srv://username:somepassword@host.u88dd.test.test/?authSource=admin&readPreference=primary&appname=mongodb-vscode+${version}&ssl=true`, }, }); }); @@ -914,7 +915,7 @@ suite('Connection Controller Test Suite', function () { delete mongoClientConnectionOptions.options.oidc?.openBrowser; assert.deepStrictEqual(mongoClientConnectionOptions, { - url: 'mongodb://localhost:27088/?appname=mongodb-vscode+0.0.0-dev.0', + url: `mongodb://localhost:27088/?appname=mongodb-vscode+${version}`, options: { autoEncryption: undefined, monitorCommands: true, @@ -929,11 +930,10 @@ suite('Connection Controller Test Suite', function () { }); test('_getConnectionStringWithProxy returns string with proxy options', () => { - const expectedConnectionStringWithProxy = - 'mongodb://localhost:27088/?appname=mongodb-vscode+0.0.0-dev.0&proxyHost=localhost&proxyPassword=gwce7tr8733ujbr&proxyPort=3378&proxyUsername=test'; + const expectedConnectionStringWithProxy = `mongodb://localhost:27088/?appname=mongodb-vscode+${version}&proxyHost=localhost&proxyPassword=gwce7tr8733ujbr&proxyPort=3378&proxyUsername=test`; const connectionString = testConnectionController._getConnectionStringWithProxy({ - url: 'mongodb://localhost:27088/?appname=mongodb-vscode+0.0.0-dev.0', + url: `mongodb://localhost:27088/?appname=mongodb-vscode+${version}`, options: { proxyHost: 'localhost', proxyPassword: 'gwce7tr8733ujbr', diff --git a/src/test/suite/editors/playgroundSelectedCodeActionProvider.test.ts b/src/test/suite/editors/playgroundSelectedCodeActionProvider.test.ts index 1871438fc..795c65048 100644 --- a/src/test/suite/editors/playgroundSelectedCodeActionProvider.test.ts +++ b/src/test/suite/editors/playgroundSelectedCodeActionProvider.test.ts @@ -14,6 +14,9 @@ import { ExportToLanguageMode } from '../../../types/playgroundType'; import { TEST_DATABASE_URI } from '../dbTestHelper'; import { ExtensionContextStub } from '../stubs'; +// eslint-disable-next-line @typescript-eslint/no-var-requires +const { version } = require('../../../../package.json'); + const expect = chai.expect; suite('Playground Selected CodeAction Provider Test Suite', function () { @@ -385,8 +388,7 @@ suite('Playground Selected CodeAction Provider Test Suite', function () { expectedResult = { namespace: 'db.coll', type: null, - content: - "# Requires the PyMongo package.\n# https://api.mongodb.com/python/current\n\nclient = MongoClient('mongodb://localhost:27088/?appname=mongodb-vscode+0.0.0-dev.0')\nfilter={\n 'name': '22'\n}\n\nresult = client['db']['coll'].find(\n filter=filter\n)", + content: `# Requires the PyMongo package.\n# https://api.mongodb.com/python/current\n\nclient = MongoClient('mongodb://localhost:27088/?appname=mongodb-vscode+${version}')\nfilter={\n 'name': '22'\n}\n\nresult = client['db']['coll'].find(\n filter=filter\n)`, language: 'python', }; @@ -460,8 +462,7 @@ suite('Playground Selected CodeAction Provider Test Suite', function () { expectedResult = { namespace: 'db.coll', type: null, - content: - "# Requires the MongoDB Ruby Driver\n# https://docs.mongodb.com/ruby-driver/master/\n\nclient = Mongo::Client.new('mongodb://localhost:27088/?appname=mongodb-vscode+0.0.0-dev.0', :database => 'db')\n\nresult = client.database['coll'].find({\n 'name' => '22'\n})", + content: `# Requires the MongoDB Ruby Driver\n# https://docs.mongodb.com/ruby-driver/master/\n\nclient = Mongo::Client.new('mongodb://localhost:27088/?appname=mongodb-vscode+${version}', :database => 'db')\n\nresult = client.database['coll'].find({\n 'name' => '22'\n})`, language: 'ruby', }; @@ -535,8 +536,7 @@ suite('Playground Selected CodeAction Provider Test Suite', function () { expectedResult = { namespace: 'db.coll', type: null, - content: - '// Requires the MongoDB Go Driver\n// https://go.mongodb.org/mongo-driver\nctx := context.TODO()\n\n// Set client options\nclientOptions := options.Client().ApplyURI("mongodb://localhost:27088/?appname=mongodb-vscode+0.0.0-dev.0")\n\n// Connect to MongoDB\nclient, err := mongo.Connect(ctx, clientOptions)\nif err != nil {\n log.Fatal(err)\n}\ndefer func() {\n if err := client.Disconnect(ctx); err != nil {\n log.Fatal(err)\n }\n}()\n\n// Find data\ncoll := client.Database("db").Collection("coll")\n_, err = coll.Find(ctx, bson.D{{"name", "22"}})\nif err != nil {\n log.Fatal(err)\n}', + content: `// Requires the MongoDB Go Driver\n// https://go.mongodb.org/mongo-driver\nctx := context.TODO()\n\n// Set client options\nclientOptions := options.Client().ApplyURI("mongodb://localhost:27088/?appname=mongodb-vscode+${version}")\n\n// Connect to MongoDB\nclient, err := mongo.Connect(ctx, clientOptions)\nif err != nil {\n log.Fatal(err)\n}\ndefer func() {\n if err := client.Disconnect(ctx); err != nil {\n log.Fatal(err)\n }\n}()\n\n// Find data\ncoll := client.Database("db").Collection("coll")\n_, err = coll.Find(ctx, bson.D{{"name", "22"}})\nif err != nil {\n log.Fatal(err)\n}`, language: 'go', }; diff --git a/src/test/suite/telemetry/telemetryService.test.ts b/src/test/suite/telemetry/telemetryService.test.ts index ea48e2da5..eac8ee584 100644 --- a/src/test/suite/telemetry/telemetryService.test.ts +++ b/src/test/suite/telemetry/telemetryService.test.ts @@ -15,6 +15,9 @@ import { mdbTestExtension } from '../stubbableMdbExtension'; import { DatabaseTreeItem, DocumentTreeItem } from '../../../explorer'; import { DataServiceStub } from '../stubs'; +// eslint-disable-next-line @typescript-eslint/no-var-requires +const { version } = require('../../../../package.json'); + const expect = chai.expect; chai.use(sinonChai); @@ -129,7 +132,7 @@ suite('Telemetry Controller Test Suite', () => { event: 'Command Run', properties: { command: 'mdb.addConnection', - extension_version: '0.0.0-dev.0', + extension_version: version, }, }) ); @@ -149,8 +152,8 @@ suite('Telemetry Controller Test Suite', () => { is_used_connect_screen: false, is_used_command_palette: true, is_used_saved_connection: false, - vscode_mdb_extension_version: '0.0.0-dev.0', - extension_version: '0.0.0-dev.0', + vscode_mdb_extension_version: version, + extension_version: version, }, }) ); @@ -170,8 +173,8 @@ suite('Telemetry Controller Test Suite', () => { is_used_connect_screen: true, is_used_command_palette: false, is_used_saved_connection: false, - vscode_mdb_extension_version: '0.0.0-dev.0', - extension_version: '0.0.0-dev.0', + vscode_mdb_extension_version: version, + extension_version: version, }, }) ); @@ -191,8 +194,8 @@ suite('Telemetry Controller Test Suite', () => { is_used_connect_screen: false, is_used_command_palette: false, is_used_saved_connection: true, - vscode_mdb_extension_version: '0.0.0-dev.0', - extension_version: '0.0.0-dev.0', + vscode_mdb_extension_version: version, + extension_version: version, }, }) ); @@ -209,7 +212,7 @@ suite('Telemetry Controller Test Suite', () => { properties: { source: 'treeview', success: true, - extension_version: '0.0.0-dev.0', + extension_version: version, }, }) ); @@ -223,7 +226,7 @@ suite('Telemetry Controller Test Suite', () => { sinon.match({ anonymousId, event: 'Document Edited', - properties: { source: 'playground', extension_version: '0.0.0-dev.0' }, + properties: { source: 'playground', extension_version: version }, }) ); }); @@ -241,7 +244,7 @@ suite('Telemetry Controller Test Suite', () => { type: 'other', partial: false, error: false, - extension_version: '0.0.0-dev.0', + extension_version: version, }, }) ); @@ -261,7 +264,7 @@ suite('Telemetry Controller Test Suite', () => { event: 'Playground Loaded', properties: { file_type: 'mongodb', - extension_version: '0.0.0-dev.0', + extension_version: version, }, }) ); @@ -280,7 +283,7 @@ suite('Telemetry Controller Test Suite', () => { event: 'Playground Loaded', properties: { file_type: 'mongodbjs', - extension_version: '0.0.0-dev.0', + extension_version: version, }, }) ); @@ -295,7 +298,7 @@ suite('Telemetry Controller Test Suite', () => { event: 'Playground Saved', properties: { file_type: 'mongodbjs', - extension_version: '0.0.0-dev.0', + extension_version: version, }, }) ); @@ -311,7 +314,7 @@ suite('Telemetry Controller Test Suite', () => { properties: { screen: 'helpPanel', link_id: 'linkId', - extension_version: '0.0.0-dev.0', + extension_version: version, }, }) ); @@ -335,7 +338,7 @@ suite('Telemetry Controller Test Suite', () => { with_import_statements: false, with_builders: false, with_driver_syntax: false, - extension_version: '0.0.0-dev.0', + extension_version: version, }, }) ); @@ -361,7 +364,7 @@ suite('Telemetry Controller Test Suite', () => { with_import_statements: false, with_builders: false, with_driver_syntax: false, - extension_version: '0.0.0-dev.0', + extension_version: version, }, }) ); @@ -551,7 +554,7 @@ suite('Telemetry Controller Test Suite', () => { event: 'Playground Created', properties: { playground_type: 'search', - extension_version: '0.0.0-dev.0', + extension_version: version, }, }) ); @@ -576,7 +579,7 @@ suite('Telemetry Controller Test Suite', () => { event: 'Playground Created', properties: { playground_type: 'createCollection', - extension_version: '0.0.0-dev.0', + extension_version: version, }, }) ); @@ -593,7 +596,7 @@ suite('Telemetry Controller Test Suite', () => { event: 'Playground Created', properties: { playground_type: 'createDatabase', - extension_version: '0.0.0-dev.0', + extension_version: version, }, }) ); @@ -611,7 +614,7 @@ suite('Telemetry Controller Test Suite', () => { event: 'Playground Created', properties: { playground_type: 'index', - extension_version: '0.0.0-dev.0', + extension_version: version, }, }) ); @@ -648,7 +651,7 @@ suite('Telemetry Controller Test Suite', () => { event: 'Playground Created', properties: { playground_type: 'cloneDocument', - extension_version: '0.0.0-dev.0', + extension_version: version, }, }) ); @@ -663,7 +666,7 @@ suite('Telemetry Controller Test Suite', () => { event: 'Playground Created', properties: { playground_type: 'crud', - extension_version: '0.0.0-dev.0', + extension_version: version, }, }) ); @@ -680,7 +683,7 @@ suite('Telemetry Controller Test Suite', () => { event: 'Playground Created', properties: { playground_type: 'crud', - extension_version: '0.0.0-dev.0', + extension_version: version, }, }) ); @@ -697,7 +700,7 @@ suite('Telemetry Controller Test Suite', () => { event: 'Playground Created', properties: { playground_type: 'crud', - extension_version: '0.0.0-dev.0', + extension_version: version, }, }) );