Skip to content

Commit

Permalink
Merge branch 'main' into patch-4
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-gilin committed Nov 12, 2022
2 parents c946433 + 48ef31d commit 3ac49d7
Show file tree
Hide file tree
Showing 16 changed files with 270 additions and 133 deletions.
100 changes: 0 additions & 100 deletions .circleci/config.yml

This file was deleted.

40 changes: 40 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Continuous Integration
on:
# Trigger the workflow on push or pull request,
# but only for the main branch
# See: https://github.community/t/duplicate-checks-on-push-and-pull-request-simultaneous-event/18012
push:
branches:
- main*
pull_request:
branches:
- main*

jobs:
build:
name: Full Build (node ${{ matrix.node_version }})
runs-on: ubuntu-latest
strategy:
matrix:
node_version: [14.x, 16.x]
# https://stackoverflow.com/questions/61070925/github-actions-disable-auto-cancel-when-job-fails
fail-fast: false

steps:
# using `v1` because of: https://github.com/actions/checkout/issues/246
- uses: actions/checkout@v1
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node_version }}
cache: 'yarn'

- name: Install dependencies
run: yarn

- name: Build
run: yarn ci

- name: Coveralls
uses: coverallsapp/github-action@1.1.3
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
20 changes: 20 additions & 0 deletions .github/workflows/commitlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Lint Commit Messages
on:
# Trigger the workflow on push or pull request,
# but only for the master branch
# See: https://github.community/t/duplicate-checks-on-push-and-pull-request-simultaneous-event/18012
push:
branches:
- main
pull_request:
branches:
- main

jobs:
commitlint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: wagoid/commitlint-github-action@v5
28 changes: 28 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Release
on:
push:
tags:
- "v*.*.*"

jobs:
release:
runs-on: ubuntu-latest
steps:
# using `v1` because of: https://github.com/actions/checkout/issues/246
- uses: actions/checkout@v1
- uses: actions/setup-node@v3
with:
node-version: lts/*
cache: 'yarn'

- name: Install dependencies
run: yarn

- name: Build & Test subpackages
run: yarn ci

- name: Create Github Release
uses: softprops/action-gh-release@v1
with:
files: packages/*/*.vsix
fail_on_unmatched_files: true
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,17 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [7.0.4](https://github.com/sap-staging/cloud-foundry-tools/compare/v7.0.1...v7.0.4) (2022-11-03)

### Bug Fixes

- [DEVXBUGS-10581] CF sign doesn't detect the last used API endpoint ([#243](https://github.com/sap-staging/cloud-foundry-tools/issues/243)) ([a2b7c93](https://github.com/sap-staging/cloud-foundry-tools/commit/a2b7c93b24db17bd292d6b30dfc3310f67680d47))
- adding tooltips to target ([e4f53e4](https://github.com/sap-staging/cloud-foundry-tools/commit/e4f53e4009971ef61f1b5305fcba4b784fb3d5dd))
- bugs ([dc5d257](https://github.com/sap-staging/cloud-foundry-tools/commit/dc5d2574c86d1f9b1bca01ea44983c1e97151988))
- panel should dispose in any case ([a5d69fd](https://github.com/sap-staging/cloud-foundry-tools/commit/a5d69fdddd0950f2af584b299865116b27f0d603))
- remove the important from the style ([a426e5c](https://github.com/sap-staging/cloud-foundry-tools/commit/a426e5cb88df128c623c08dc4cedfcc98d9376a6))
- review fixes ([cb0361d](https://github.com/sap-staging/cloud-foundry-tools/commit/cb0361d25817a06fbe8379e583f9cbda6eb2fa05))

## [7.0.1](https://github.com/SAP/cloud-foundry-tools/compare/v7.0.0...v7.0.1) (2022-06-29)

### Bug Fixes
Expand Down
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@
"allowBranch": "master"
}
},
"version": "7.0.1"
"version": "7.0.4"
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
},
"scripts": {
"release:version": "lerna version",
"release:publish": "lerna publish from-git --yes",
"release:publish": "lerna publish from-git --yes --no-verify-access",
"ci": "npm-run-all legal:* coverage:clean format:validate lint:validate ci:subpackages coverage:merge",
"ci:subpackages": "lerna run ci",
"ci:artifacts_only": "lerna run ci:artifacts_only",
Expand Down
10 changes: 10 additions & 0 deletions packages/backend/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,16 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [7.0.4](https://github.com/sap-staging/cloud-foundry-tools/compare/v7.0.1...v7.0.4) (2022-11-03)

### Bug Fixes

- [DEVXBUGS-10581] CF sign doesn't detect the last used API endpoint ([#243](https://github.com/sap-staging/cloud-foundry-tools/issues/243)) ([a2b7c93](https://github.com/sap-staging/cloud-foundry-tools/commit/a2b7c93b24db17bd292d6b30dfc3310f67680d47))
- adding tooltips to target ([e4f53e4](https://github.com/sap-staging/cloud-foundry-tools/commit/e4f53e4009971ef61f1b5305fcba4b784fb3d5dd))
- bugs ([dc5d257](https://github.com/sap-staging/cloud-foundry-tools/commit/dc5d2574c86d1f9b1bca01ea44983c1e97151988))
- panel should dispose in any case ([a5d69fd](https://github.com/sap-staging/cloud-foundry-tools/commit/a5d69fdddd0950f2af584b299865116b27f0d603))
- remove the important from the style ([a426e5c](https://github.com/sap-staging/cloud-foundry-tools/commit/a426e5cb88df128c623c08dc4cedfcc98d9376a6))

## [7.0.1](https://github.com/sap-staging/cloud-foundry-tools/compare/v7.0.0...v7.0.1) (2022-06-29)

### Bug Fixes
Expand Down
6 changes: 3 additions & 3 deletions packages/backend/nyc.config.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
const baseNycConfig = require("../../nyc.config");

module.exports = Object.assign(baseNycConfig, {
branches: 77,
branches: 78,
lines: 75,
functions: 72,
statements: 75,
functions: 73,
statements: 76,
include: ["**/src/**"],
exclude: ["**/src/run-configuration-*", "**/src/sql-tools.ts", "**/src/logger/logger-wrapper.ts", "**/usage/*.ts"],
});
24 changes: 13 additions & 11 deletions packages/backend/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "vscode-wing-cf-tools",
"displayName": "Cloud Foundry Tools",
"version": "7.0.1",
"version": "7.0.4",
"private": true,
"description": "Vscode extension of Cloud Foundry tools",
"categories": [
Expand All @@ -19,21 +19,21 @@
"publisher": "SAP",
"main": "./dist/extension.js",
"scripts": {
"build": "npm-run-all clean compile webpack-dev frontend:all",
"bundle": "webpack --mode production",
"ci": "npm-run-all clean compile copy:test-resources coverage bundle frontend:all package",
"ci:artifacts_only": "npm-run-all clean compile webpack-dev frontend:all package",
"frontend:all": "cd ../frontend && npm run build && cd ../backend && npm run frontend:copy",
"frontend:copy": "npm-run-all clean:frontend && shx cp -r ../frontend/dist/. ./dist/media/",
"clean:frontend": "cd dist/ && shx rm -rf ./media",
"coverage": "nyc mocha --colors",
"bundle": "webpack --mode production",
"build": "npm-run-all clean compile webpack-dev frontend:all",
"copy:test-resources": "shx cp -r ./tests/resources ./out/tests/resources",
"clean": "npm-run-all clean:dist clean:out clean:vsix",
"clean:dist": "rimraf ./dist",
"clean:frontend": "cd dist/ && shx rm -rf ./media",
"clean:out": "rimraf ./out",
"clean:vsix": "rimraf ./*.vsix",
"package": "vsce package --yarn",
"compile": "tsc -p ./",
"copy:test-resources": "shx cp -r ./tests/resources ./out/tests/resources",
"coverage": "nyc mocha --colors",
"frontend:all": "cd ../frontend && npm run build && cd ../backend && npm run frontend:copy",
"frontend:copy": "npm-run-all clean:frontend && shx cp -r ../frontend/dist/. ./dist/media/",
"package": "vsce package --yarn",
"test": "mocha --colors",
"watch": "tsc -watch -p ./",
"webpack-dev": "webpack --mode development",
Expand Down Expand Up @@ -343,15 +343,17 @@
"@types/mocha": "^9.1.0",
"@types/node": "^14.14.6",
"@types/properties-reader": "2.1.1",
"@types/sinon": "^10.0.11",
"@types/proxyquire": "^1.3.28",
"@types/sinon": "^10.0.13",
"@types/vscode": "^1.43.0",
"@vscode-logging/types": "0.1.4",
"chai": "^4.3.6",
"clean-webpack-plugin": "^4.0.0",
"coveralls": "^3.1.1",
"cz-conventional-changelog": "3.3.0",
"mocha": "^9.2.2",
"sinon": "^13.0.2",
"proxyquire": "2.1.3",
"sinon": "^14.0.1",
"standard-version": "^9.3.2",
"temp-dir": "^2.0.0",
"ts-loader": "^9.2.8",
Expand Down
16 changes: 10 additions & 6 deletions packages/backend/src/loginTargetView/loginTargetView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import * as _ from "lodash";
import { messages } from "../messages";
import { join, sep } from "path";

export let _rpc: RpcExtension;
let _rpc: RpcExtension;

let currentTarget: ITarget | undefined;
let initTarget: { endpoint: string | undefined; org?: string | undefined; space?: string | undefined };
Expand Down Expand Up @@ -131,11 +131,10 @@ async function getTarget(): Promise<ITarget | undefined> {
//logged in then need to show the target section
}

async function getCFDefaultLandscape(): Promise<string> {
const apiFromEnv = _.get(process, "env.CF_API_ENDPOINT", "") as string;
const apiFromFile = (await cfGetConfigFileField("Target")) as string;

return apiFromEnv || apiFromFile;
function getCFDefaultLandscape(): Promise<string> {
return cfGetConfigFileField("Target").then((cfgEndpoint: string) => {
return cfgEndpoint || _.get(process, "env.CF_API_ENDPOINT", "");
});
}

function calculatePasscodeUrl(endpoint: string): string {
Expand Down Expand Up @@ -240,3 +239,8 @@ export async function invokeLongFunctionWithProgressForm(longFunction: Function,
throw error;
}
}

// for testing purpose only
export const internal = {
getCFDefaultLandscape,
};
Loading

0 comments on commit 3ac49d7

Please sign in to comment.