Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
212ea02e4c |
@@ -1,7 +0,0 @@
|
||||
registry=https://pkgs.dev.azure.com/azure-public/VisualCpp/_packaging/cpp_PublicPackages/npm/registry/
|
||||
# Disable postinstall scripts for supply chain security. Allowlist exceptions with npm trust: https://docs.npmjs.com/cli/v11/commands/npm-trust
|
||||
ignore-scripts=true
|
||||
|
||||
min-release-age=7
|
||||
audit=true
|
||||
audit-level=high
|
||||
@@ -1,86 +0,0 @@
|
||||
"use strict";
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See LICENSE in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.AddComment = void 0;
|
||||
const ActionBase_1 = require("../common/ActionBase");
|
||||
const utils_1 = require("../common/utils");
|
||||
class AddComment extends ActionBase_1.ActionBase {
|
||||
constructor(github, createdAfter, afterDays, labels, addComment, addLabels, removeLabels, setMilestoneId, milestoneName, milestoneId, ignoreLabels, ignoreMilestoneNames, ignoreMilestoneIds, minimumVotes, maximumVotes, involves) {
|
||||
super(labels, milestoneName, milestoneId, ignoreLabels, ignoreMilestoneNames, ignoreMilestoneIds, minimumVotes, maximumVotes, involves);
|
||||
this.github = github;
|
||||
this.createdAfter = createdAfter;
|
||||
this.afterDays = afterDays;
|
||||
this.addComment = addComment;
|
||||
this.addLabels = addLabels;
|
||||
this.removeLabels = removeLabels;
|
||||
this.setMilestoneId = setMilestoneId;
|
||||
}
|
||||
async run() {
|
||||
const updatedTimestamp = this.afterDays ? (0, utils_1.daysAgoToHumanReadbleDate)(this.afterDays) : undefined;
|
||||
const query = this.buildQuery((updatedTimestamp ? `updated:<${updatedTimestamp} ` : "") +
|
||||
(this.createdAfter ? `created:>${this.createdAfter} ` : "") +
|
||||
"is:open is:unlocked");
|
||||
const addLabelsSet = this.addLabels ? this.addLabels.split(',') : [];
|
||||
const removeLabelsSet = this.removeLabels ? this.removeLabels.split(',') : [];
|
||||
for await (const page of this.github.query({ q: query })) {
|
||||
for (const issue of page) {
|
||||
const hydrated = await issue.getIssue();
|
||||
if (hydrated.open && this.validateIssue(hydrated)
|
||||
// TODO: Verify updated timestamp
|
||||
) {
|
||||
// Don't add a comment if already commented on by an action.
|
||||
let foundActionComment = false;
|
||||
for await (const commentBatch of issue.getComments()) {
|
||||
for (const comment of commentBatch) {
|
||||
if (comment.author.isGitHubApp) {
|
||||
foundActionComment = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (foundActionComment)
|
||||
break;
|
||||
}
|
||||
if (foundActionComment) {
|
||||
(0, utils_1.safeLog)(`Issue ${hydrated.number} already commented on by an action. Ignoring.`);
|
||||
continue;
|
||||
}
|
||||
if (this.addComment) {
|
||||
(0, utils_1.safeLog)(`Posting comment on issue ${hydrated.number}`);
|
||||
await issue.postComment(this.addComment);
|
||||
}
|
||||
if (removeLabelsSet.length > 0) {
|
||||
for (const removeLabel of removeLabelsSet) {
|
||||
if (removeLabel && removeLabel.length > 0) {
|
||||
(0, utils_1.safeLog)(`Removing label on issue ${hydrated.number}: ${removeLabel}`);
|
||||
await issue.removeLabel(removeLabel);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (addLabelsSet.length > 0) {
|
||||
for (const addLabel of addLabelsSet) {
|
||||
if (addLabel && addLabel.length > 0) {
|
||||
(0, utils_1.safeLog)(`Adding label on issue ${hydrated.number}: ${addLabel}`);
|
||||
await issue.addLabel(addLabel);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (this.setMilestoneId != undefined) {
|
||||
(0, utils_1.safeLog)(`Setting milestone of issue ${hydrated.number} to id ${+this.setMilestoneId}`);
|
||||
await issue.setMilestone(+this.setMilestoneId);
|
||||
}
|
||||
(0, utils_1.safeLog)(`Processing issue ${hydrated.number}.`);
|
||||
}
|
||||
else {
|
||||
if (!hydrated.open) {
|
||||
(0, utils_1.safeLog)(`Issue ${hydrated.number} is not open. Ignoring`);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
exports.AddComment = AddComment;
|
||||
//# sourceMappingURL=AddComment.js.map
|
||||
@@ -1,98 +0,0 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See LICENSE in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { GitHub } from '../api/api';
|
||||
import { ActionBase } from '../common/ActionBase';
|
||||
import { daysAgoToHumanReadbleDate, daysAgoToTimestamp, safeLog } from '../common/utils';
|
||||
|
||||
export class AddComment extends ActionBase {
|
||||
constructor(
|
||||
private github: GitHub,
|
||||
private createdAfter: string | undefined,
|
||||
private afterDays: number,
|
||||
labels: string,
|
||||
private addComment: string,
|
||||
private addLabels?: string,
|
||||
private removeLabels?: string,
|
||||
private setMilestoneId?: string,
|
||||
milestoneName?: string,
|
||||
milestoneId?: string,
|
||||
ignoreLabels?: string,
|
||||
ignoreMilestoneNames?: string,
|
||||
ignoreMilestoneIds?: string,
|
||||
minimumVotes?: number,
|
||||
maximumVotes?: number,
|
||||
involves?: string
|
||||
) {
|
||||
super(labels, milestoneName, milestoneId, ignoreLabels, ignoreMilestoneNames, ignoreMilestoneIds, minimumVotes, maximumVotes, involves);
|
||||
}
|
||||
|
||||
async run() {
|
||||
const updatedTimestamp = this.afterDays ? daysAgoToHumanReadbleDate(this.afterDays) : undefined;
|
||||
const query = this.buildQuery(
|
||||
(updatedTimestamp ? `updated:<${updatedTimestamp} ` : "") +
|
||||
(this.createdAfter ? `created:>${this.createdAfter} ` : "") +
|
||||
"is:open is:unlocked");
|
||||
|
||||
const addLabelsSet = this.addLabels ? this.addLabels.split(',') : [];
|
||||
const removeLabelsSet = this.removeLabels ? this.removeLabels.split(',') : [];
|
||||
|
||||
for await (const page of this.github.query({ q: query })) {
|
||||
for (const issue of page) {
|
||||
const hydrated = await issue.getIssue();
|
||||
if (hydrated.open && this.validateIssue(hydrated)
|
||||
// TODO: Verify updated timestamp
|
||||
) {
|
||||
// Don't add a comment if already commented on by an action.
|
||||
let foundActionComment = false;
|
||||
for await (const commentBatch of issue.getComments()) {
|
||||
for (const comment of commentBatch) {
|
||||
if (comment.author.isGitHubApp) {
|
||||
foundActionComment = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (foundActionComment)
|
||||
break;
|
||||
}
|
||||
if (foundActionComment) {
|
||||
safeLog(`Issue ${hydrated.number} already commented on by an action. Ignoring.`);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (this.addComment) {
|
||||
safeLog(`Posting comment on issue ${hydrated.number}`);
|
||||
await issue.postComment(this.addComment);
|
||||
}
|
||||
if (removeLabelsSet.length > 0) {
|
||||
for (const removeLabel of removeLabelsSet) {
|
||||
if (removeLabel && removeLabel.length > 0) {
|
||||
safeLog(`Removing label on issue ${hydrated.number}: ${removeLabel}`);
|
||||
await issue.removeLabel(removeLabel);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (addLabelsSet.length > 0) {
|
||||
for (const addLabel of addLabelsSet) {
|
||||
if (addLabel && addLabel.length > 0) {
|
||||
safeLog(`Adding label on issue ${hydrated.number}: ${addLabel}`);
|
||||
await issue.addLabel(addLabel);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (this.setMilestoneId != undefined) {
|
||||
safeLog(`Setting milestone of issue ${hydrated.number} to id ${+this.setMilestoneId}`);
|
||||
await issue.setMilestone(+this.setMilestoneId);
|
||||
}
|
||||
safeLog(`Processing issue ${hydrated.number}.`);
|
||||
} else {
|
||||
if (!hydrated.open) {
|
||||
safeLog(`Issue ${hydrated.number} is not open. Ignoring`);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,42 +0,0 @@
|
||||
name: Add Comment and Label
|
||||
description: Add comment (etc) to issues that are marked with a specified label (etc)
|
||||
inputs:
|
||||
token:
|
||||
description: GitHub token with issue, comment, and label read/write permissions
|
||||
default: ${{ github.token }}
|
||||
createdAfter:
|
||||
description: Creation date after which to be considered.
|
||||
required: false
|
||||
afterDays:
|
||||
description: Days to wait before performing this action (may be 0).
|
||||
required: false
|
||||
addComment:
|
||||
description: Comment to add
|
||||
labels:
|
||||
description: items with these labels will be considered. May be "*".
|
||||
required: true
|
||||
milestoneName:
|
||||
description: items with these milestones will be considered (name only, must match ID)
|
||||
milestoneId:
|
||||
description: items with these milestones will be considered (id only, must match name)
|
||||
ignoreLabels:
|
||||
description: items with these labels will not be considered
|
||||
ignoreMilestoneNames:
|
||||
description: items with these milestones will not be considered (names only, must match IDs). May be "*".
|
||||
ignoreMilestoneIds:
|
||||
description: items with these milestones will not be considered (IDs only, must match names)
|
||||
addLabels:
|
||||
description: Labels to add to issue.
|
||||
removeLabels:
|
||||
description: Labels to remove from issue.
|
||||
minimumVotes:
|
||||
descriptions: Only issues with at least this many votes will be considered.
|
||||
maximumVotes:
|
||||
descriptions: Only issues fewer or equal to this many votes will be considered.
|
||||
involves:
|
||||
descriptions: Qualifier to find issues that in some way involve a certain user either as an author, assignee, or mentions.
|
||||
readonly:
|
||||
description: If true, changes are not applied.
|
||||
runs:
|
||||
using: 'node24'
|
||||
main: 'index.js'
|
||||
@@ -1,20 +0,0 @@
|
||||
"use strict";
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See LICENSE in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const utils_1 = require("../common/utils");
|
||||
const AddComment_1 = require("./AddComment");
|
||||
const Action_1 = require("../common/Action");
|
||||
class AddCommentAction extends Action_1.Action {
|
||||
constructor() {
|
||||
super(...arguments);
|
||||
this.id = 'AddComment';
|
||||
}
|
||||
async onTriggered(github) {
|
||||
await new AddComment_1.AddComment(github, (0, utils_1.getInput)('createdAfter') || undefined, +((0, utils_1.getInput)('afterDays') || 0), (0, utils_1.getRequiredInput)('labels'), (0, utils_1.getInput)('addComment') || '', (0, utils_1.getInput)('addLabels') || undefined, (0, utils_1.getInput)('removeLabels') || undefined, (0, utils_1.getInput)('setMilestoneId') || undefined, (0, utils_1.getInput)('milestoneName') || undefined, (0, utils_1.getInput)('milestoneId') || undefined, (0, utils_1.getInput)('ignoreLabels') || undefined, (0, utils_1.getInput)('ignoreMilestoneNames') || undefined, (0, utils_1.getInput)('ignoreMilestoneIds') || undefined, +((0, utils_1.getInput)('minimumVotes') || 0), +((0, utils_1.getInput)('maximumVotes') || 9999999), (0, utils_1.getInput)('involves') || undefined).run();
|
||||
}
|
||||
}
|
||||
new AddCommentAction().run(); // eslint-disable-line
|
||||
//# sourceMappingURL=index.js.map
|
||||
@@ -1,36 +0,0 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See LICENSE in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { OctoKit } from '../api/octokit'
|
||||
import { getInput, getRequiredInput } from '../common/utils'
|
||||
import { AddComment } from './AddComment'
|
||||
import { Action } from '../common/Action'
|
||||
|
||||
class AddCommentAction extends Action {
|
||||
id = 'AddComment';
|
||||
|
||||
async onTriggered(github: OctoKit) {
|
||||
await new AddComment(
|
||||
github,
|
||||
getInput('createdAfter') || undefined,
|
||||
+(getInput('afterDays') || 0),
|
||||
getRequiredInput('labels'),
|
||||
getInput('addComment') || '',
|
||||
getInput('addLabels') || undefined,
|
||||
getInput('removeLabels') || undefined,
|
||||
getInput('setMilestoneId') || undefined,
|
||||
getInput('milestoneName') || undefined,
|
||||
getInput('milestoneId') || undefined,
|
||||
getInput('ignoreLabels') || undefined,
|
||||
getInput('ignoreMilestoneNames') || undefined,
|
||||
getInput('ignoreMilestoneIds') || undefined,
|
||||
+(getInput('minimumVotes') || 0),
|
||||
+(getInput('maximumVotes') || 9999999),
|
||||
getInput('involves') || undefined
|
||||
).run();
|
||||
}
|
||||
}
|
||||
|
||||
new AddCommentAction().run(); // eslint-disable-line
|
||||
@@ -15,7 +15,7 @@ inputs:
|
||||
milestoneId:
|
||||
description: items with these milestones will be considered (id only, must match name)
|
||||
labels:
|
||||
description: items with these labels will be considered. May be "*".
|
||||
description: items with these labels will not be considered. May be "*".
|
||||
ignoreMilestoneNames:
|
||||
description: items with these milestones will not be considered (names only, must match IDs). May be "*".
|
||||
ignoreMilestoneIds:
|
||||
@@ -29,5 +29,5 @@ inputs:
|
||||
readonly:
|
||||
description: If true, changes are not applied.
|
||||
runs:
|
||||
using: 'node24'
|
||||
using: 'node12'
|
||||
main: 'index.js'
|
||||
|
||||
@@ -19,7 +19,7 @@ inputs:
|
||||
milestoneId:
|
||||
description: items with these milestones will be considered (id only, must match name)
|
||||
labels:
|
||||
description: items with these labels will be considered. May be "*".
|
||||
description: items with these labels will not be considered. May be "*".
|
||||
ignoreMilestoneNames:
|
||||
description: items with these milestones will not be considered (names only, must match IDs). May be "*".
|
||||
ignoreMilestoneIds:
|
||||
@@ -33,5 +33,5 @@ inputs:
|
||||
readonly:
|
||||
description: If true, changes are not applied.
|
||||
runs:
|
||||
using: 'node24'
|
||||
using: 'node12'
|
||||
main: 'index.js'
|
||||
|
||||
@@ -1,106 +1,106 @@
|
||||
"use strict";
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See LICENSE in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.StaleCloser = void 0;
|
||||
const ActionBase_1 = require("../common/ActionBase");
|
||||
const utils_1 = require("../common/utils");
|
||||
class StaleCloser extends ActionBase_1.ActionBase {
|
||||
constructor(github, closeDays, labels, closeComment, pingDays, pingComment, additionalTeam, addLabels, removeLabels, setMilestoneId, milestoneName, milestoneId, ignoreLabels, ignoreMilestoneNames, ignoreMilestoneIds, minimumVotes, maximumVotes, involves) {
|
||||
super(labels, milestoneName, milestoneId, ignoreLabels, ignoreMilestoneNames, ignoreMilestoneIds, minimumVotes, maximumVotes, involves);
|
||||
this.github = github;
|
||||
this.closeDays = closeDays;
|
||||
this.closeComment = closeComment;
|
||||
this.pingDays = pingDays;
|
||||
this.pingComment = pingComment;
|
||||
this.additionalTeam = additionalTeam;
|
||||
this.addLabels = addLabels;
|
||||
this.removeLabels = removeLabels;
|
||||
this.setMilestoneId = setMilestoneId;
|
||||
}
|
||||
async run() {
|
||||
const updatedTimestamp = this.closeDays ? (0, utils_1.daysAgoToHumanReadbleDate)(this.closeDays) : undefined;
|
||||
const pingTimestamp = this.pingDays ? (0, utils_1.daysAgoToTimestamp)(this.pingDays) : undefined;
|
||||
const query = this.buildQuery((updatedTimestamp ? `updated:<${updatedTimestamp} ` : "") + "is:open is:unlocked");
|
||||
const addLabelsSet = this.addLabels ? this.addLabels.split(',') : [];
|
||||
const removeLabelsSet = this.removeLabels ? this.removeLabels.split(',') : [];
|
||||
for await (const page of this.github.query({ q: query })) {
|
||||
for (const issue of page) {
|
||||
const hydrated = await issue.getIssue();
|
||||
const lastCommentIterator = await issue.getComments(true).next();
|
||||
if (lastCommentIterator.done) {
|
||||
throw Error('Unexpected comment data');
|
||||
}
|
||||
const lastComment = lastCommentIterator.value[0];
|
||||
if (hydrated.open && this.validateIssue(hydrated)
|
||||
// TODO: Verify updated timestamp
|
||||
) {
|
||||
if (!lastComment ||
|
||||
lastComment.author.isGitHubApp ||
|
||||
pingTimestamp == undefined ||
|
||||
// TODO: List the collaborators once per go rather than checking a single user each issue
|
||||
this.additionalTeam.includes(lastComment.author.name) ||
|
||||
await issue.hasWriteAccess(lastComment.author)) {
|
||||
if (pingTimestamp != undefined) {
|
||||
if (lastComment) {
|
||||
(0, utils_1.safeLog)(`Last comment on issue ${hydrated.number} by ${lastComment.author.name}. Closing.`);
|
||||
}
|
||||
else {
|
||||
(0, utils_1.safeLog)(`No comments on issue ${hydrated.number}. Closing.`);
|
||||
}
|
||||
}
|
||||
if (this.closeComment) {
|
||||
(0, utils_1.safeLog)(`Posting comment on issue ${hydrated.number}`);
|
||||
await issue.postComment(this.closeComment);
|
||||
}
|
||||
if (removeLabelsSet.length > 0) {
|
||||
for (const removeLabel of removeLabelsSet) {
|
||||
if (removeLabel && removeLabel.length > 0) {
|
||||
(0, utils_1.safeLog)(`Removing label on issue ${hydrated.number}: ${removeLabel}`);
|
||||
await issue.removeLabel(removeLabel);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (addLabelsSet.length > 0) {
|
||||
for (const addLabel of addLabelsSet) {
|
||||
if (addLabel && addLabel.length > 0) {
|
||||
(0, utils_1.safeLog)(`Adding label on issue ${hydrated.number}: ${addLabel}`);
|
||||
await issue.addLabel(addLabel);
|
||||
}
|
||||
}
|
||||
}
|
||||
await issue.closeIssue("not_planned");
|
||||
if (this.setMilestoneId != undefined) {
|
||||
(0, utils_1.safeLog)(`Setting milestone of issue ${hydrated.number} to id ${+this.setMilestoneId}`);
|
||||
await issue.setMilestone(+this.setMilestoneId);
|
||||
}
|
||||
(0, utils_1.safeLog)(`Closing issue ${hydrated.number}.`);
|
||||
}
|
||||
else {
|
||||
// Ping
|
||||
if (hydrated.updatedAt < pingTimestamp && hydrated.assignee) {
|
||||
(0, utils_1.safeLog)(`Last comment on issue ${hydrated.number} by ${lastComment.author.name}. Pinging @${hydrated.assignee}`);
|
||||
if (this.pingComment) {
|
||||
await issue.postComment(this.pingComment
|
||||
.replace('${assignee}', hydrated.assignee)
|
||||
.replace('${author}', hydrated.author.name));
|
||||
}
|
||||
}
|
||||
else {
|
||||
(0, utils_1.safeLog)(`Last comment on issue ${hydrated.number} by ${lastComment.author.name}. Skipping.${hydrated.assignee ? ' cc @' + hydrated.assignee : ''}`);
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (!hydrated.open) {
|
||||
(0, utils_1.safeLog)(`Issue ${hydrated.number} is not open. Ignoring`);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
exports.StaleCloser = StaleCloser;
|
||||
"use strict";
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See LICENSE in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.StaleCloser = void 0;
|
||||
const ActionBase_1 = require("../common/ActionBase");
|
||||
const utils_1 = require("../common/utils");
|
||||
class StaleCloser extends ActionBase_1.ActionBase {
|
||||
constructor(github, closeDays, labels, closeComment, pingDays, pingComment, additionalTeam, addLabels, removeLabels, setMilestoneId, milestoneName, milestoneId, ignoreLabels, ignoreMilestoneNames, ignoreMilestoneIds, minimumVotes, maximumVotes, involves) {
|
||||
super(labels, milestoneName, milestoneId, ignoreLabels, ignoreMilestoneNames, ignoreMilestoneIds, minimumVotes, maximumVotes, involves);
|
||||
this.github = github;
|
||||
this.closeDays = closeDays;
|
||||
this.closeComment = closeComment;
|
||||
this.pingDays = pingDays;
|
||||
this.pingComment = pingComment;
|
||||
this.additionalTeam = additionalTeam;
|
||||
this.addLabels = addLabels;
|
||||
this.removeLabels = removeLabels;
|
||||
this.setMilestoneId = setMilestoneId;
|
||||
}
|
||||
async run() {
|
||||
const updatedTimestamp = (0, utils_1.daysAgoToHumanReadbleDate)(this.closeDays);
|
||||
const pingTimestamp = this.pingDays ? (0, utils_1.daysAgoToTimestamp)(this.pingDays) : undefined;
|
||||
const query = this.buildQuery((this.closeDays ? `updated:<${updatedTimestamp} ` : "") + "is:open is:unlocked");
|
||||
const addLabelsSet = this.addLabels ? this.addLabels.split(',') : [];
|
||||
const removeLabelsSet = this.removeLabels ? this.removeLabels.split(',') : [];
|
||||
for await (const page of this.github.query({ q: query })) {
|
||||
for (const issue of page) {
|
||||
const hydrated = await issue.getIssue();
|
||||
const lastCommentIterator = await issue.getComments(true).next();
|
||||
if (lastCommentIterator.done) {
|
||||
throw Error('Unexpected comment data');
|
||||
}
|
||||
const lastComment = lastCommentIterator.value[0];
|
||||
if (hydrated.open && this.validateIssue(hydrated)
|
||||
// TODO: Verify updated timestamp
|
||||
) {
|
||||
if (!lastComment ||
|
||||
lastComment.author.isGitHubApp ||
|
||||
pingTimestamp == undefined ||
|
||||
// TODO: List the collaborators once per go rather than checking a single user each issue
|
||||
this.additionalTeam.includes(lastComment.author.name) ||
|
||||
await issue.hasWriteAccess(lastComment.author)) {
|
||||
if (pingTimestamp != undefined) {
|
||||
if (lastComment) {
|
||||
(0, utils_1.safeLog)(`Last comment on issue ${hydrated.number} by ${lastComment.author.name}. Closing.`);
|
||||
}
|
||||
else {
|
||||
(0, utils_1.safeLog)(`No comments on issue ${hydrated.number}. Closing.`);
|
||||
}
|
||||
}
|
||||
if (this.closeComment) {
|
||||
(0, utils_1.safeLog)(`Posting comment on issue ${hydrated.number}`);
|
||||
await issue.postComment(this.closeComment);
|
||||
}
|
||||
if (removeLabelsSet.length > 0) {
|
||||
for (const removeLabel of removeLabelsSet) {
|
||||
if (removeLabel && removeLabel.length > 0) {
|
||||
(0, utils_1.safeLog)(`Removing label on issue ${hydrated.number}: ${removeLabel}`);
|
||||
await issue.removeLabel(removeLabel);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (addLabelsSet.length > 0) {
|
||||
for (const addLabel of addLabelsSet) {
|
||||
if (addLabel && addLabel.length > 0) {
|
||||
(0, utils_1.safeLog)(`Adding label on issue ${hydrated.number}: ${addLabel}`);
|
||||
await issue.addLabel(addLabel);
|
||||
}
|
||||
}
|
||||
}
|
||||
await issue.closeIssue("not_planned");
|
||||
if (this.setMilestoneId != undefined) {
|
||||
(0, utils_1.safeLog)(`Setting milestone of issue ${hydrated.number} to id ${+this.setMilestoneId}`);
|
||||
await issue.setMilestone(+this.setMilestoneId);
|
||||
}
|
||||
(0, utils_1.safeLog)(`Closing issue ${hydrated.number}.`);
|
||||
}
|
||||
else {
|
||||
// Ping
|
||||
if (hydrated.updatedAt < pingTimestamp && hydrated.assignee) {
|
||||
(0, utils_1.safeLog)(`Last comment on issue ${hydrated.number} by ${lastComment.author.name}. Pinging @${hydrated.assignee}`);
|
||||
if (this.pingComment) {
|
||||
await issue.postComment(this.pingComment
|
||||
.replace('${assignee}', hydrated.assignee)
|
||||
.replace('${author}', hydrated.author.name));
|
||||
}
|
||||
}
|
||||
else {
|
||||
(0, utils_1.safeLog)(`Last comment on issue ${hydrated.number} by ${lastComment.author.name}. Skipping.${hydrated.assignee ? ' cc @' + hydrated.assignee : ''}`);
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (!hydrated.open) {
|
||||
(0, utils_1.safeLog)(`Issue ${hydrated.number} is not open. Ignoring`);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
exports.StaleCloser = StaleCloser;
|
||||
//# sourceMappingURL=StaleCloser.js.map
|
||||
@@ -33,10 +33,10 @@ export class StaleCloser extends ActionBase {
|
||||
}
|
||||
|
||||
async run() {
|
||||
const updatedTimestamp = this.closeDays ? daysAgoToHumanReadbleDate(this.closeDays) : undefined;
|
||||
const updatedTimestamp = daysAgoToHumanReadbleDate(this.closeDays);
|
||||
const pingTimestamp = this.pingDays ? daysAgoToTimestamp(this.pingDays) : undefined;
|
||||
|
||||
const query = this.buildQuery((updatedTimestamp ? `updated:<${updatedTimestamp} ` : "") + "is:open is:unlocked");
|
||||
const query = this.buildQuery((this.closeDays ? `updated:<${updatedTimestamp} ` : "") + "is:open is:unlocked");
|
||||
|
||||
const addLabelsSet = this.addLabels ? this.addLabels.split(',') : [];
|
||||
const removeLabelsSet = this.removeLabels ? this.removeLabels.split(',') : [];
|
||||
|
||||
@@ -20,7 +20,7 @@ inputs:
|
||||
milestoneId:
|
||||
description: items with these milestones will be considered (id only, must match name)
|
||||
labels:
|
||||
description: items with these labels will be considered. May be "*".
|
||||
description: items with these labels will not be considered. May be "*".
|
||||
required: true
|
||||
ignoreMilestoneNames:
|
||||
description: items with these milestones will not be considered (names only, must match IDs). May be "*".
|
||||
@@ -43,5 +43,5 @@ inputs:
|
||||
readonly:
|
||||
description: If true, changes are not applied.
|
||||
runs:
|
||||
using: 'node24'
|
||||
using: 'node12'
|
||||
main: 'index.js'
|
||||
|
||||
@@ -1,21 +1,21 @@
|
||||
"use strict";
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See LICENSE in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const utils_1 = require("../common/utils");
|
||||
const StaleCloser_1 = require("./StaleCloser");
|
||||
const Action_1 = require("../common/Action");
|
||||
class StaleCloserAction extends Action_1.Action {
|
||||
constructor() {
|
||||
super(...arguments);
|
||||
this.id = 'StaleCloser';
|
||||
}
|
||||
async onTriggered(github) {
|
||||
var _a;
|
||||
await new StaleCloser_1.StaleCloser(github, +(0, utils_1.getRequiredInput)('closeDays'), (0, utils_1.getRequiredInput)('labels'), (0, utils_1.getInput)('closeComment') || '', +((0, utils_1.getInput)('pingDays') || 0), (0, utils_1.getInput)('pingComment') || '', ((_a = (0, utils_1.getInput)('additionalTeam')) !== null && _a !== void 0 ? _a : '').split(','), (0, utils_1.getInput)('addLabels') || undefined, (0, utils_1.getInput)('removeLabels') || undefined, (0, utils_1.getInput)('setMilestoneId') || undefined, (0, utils_1.getInput)('milestoneName') || undefined, (0, utils_1.getInput)('milestoneId') || undefined, (0, utils_1.getInput)('ignoreLabels') || undefined, (0, utils_1.getInput)('ignoreMilestoneNames') || undefined, (0, utils_1.getInput)('ignoreMilestoneIds') || undefined, +((0, utils_1.getInput)('minimumVotes') || 0), +((0, utils_1.getInput)('maximumVotes') || 9999999), (0, utils_1.getInput)('involves') || undefined).run();
|
||||
}
|
||||
}
|
||||
new StaleCloserAction().run(); // eslint-disable-line
|
||||
"use strict";
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See LICENSE in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const utils_1 = require("../common/utils");
|
||||
const StaleCloser_1 = require("./StaleCloser");
|
||||
const Action_1 = require("../common/Action");
|
||||
class StaleCloserAction extends Action_1.Action {
|
||||
constructor() {
|
||||
super(...arguments);
|
||||
this.id = 'StaleCloser';
|
||||
}
|
||||
async onTriggered(github) {
|
||||
var _a;
|
||||
await new StaleCloser_1.StaleCloser(github, +(0, utils_1.getRequiredInput)('closeDays'), (0, utils_1.getRequiredInput)('labels'), (0, utils_1.getInput)('closeComment') || '', +((0, utils_1.getInput)('pingDays') || 0), (0, utils_1.getInput)('pingComment') || '', ((_a = (0, utils_1.getInput)('additionalTeam')) !== null && _a !== void 0 ? _a : '').split(','), (0, utils_1.getInput)('addLabels') || undefined, (0, utils_1.getInput)('removeLabels') || undefined, (0, utils_1.getInput)('setMilestoneId') || undefined, (0, utils_1.getInput)('milestoneName') || undefined, (0, utils_1.getInput)('milestoneId') || undefined, (0, utils_1.getInput)('ignoreLabels') || undefined, (0, utils_1.getInput)('ignoreMilestoneNames') || undefined, (0, utils_1.getInput)('ignoreMilestoneIds') || undefined, +((0, utils_1.getInput)('minimumVotes') || 0), +((0, utils_1.getInput)('maximumVotes') || 9999999), (0, utils_1.getInput)('involves') || undefined).run();
|
||||
}
|
||||
}
|
||||
new StaleCloserAction().run(); // eslint-disable-line
|
||||
//# sourceMappingURL=index.js.map
|
||||
@@ -12,10 +12,6 @@ let numRequests = 0;
|
||||
const getNumRequests = () => numRequests;
|
||||
exports.getNumRequests = getNumRequests;
|
||||
class OctoKit {
|
||||
get octokit() {
|
||||
numRequests++;
|
||||
return this._octokit;
|
||||
}
|
||||
constructor(token, params, options = { readonly: false }) {
|
||||
this.token = token;
|
||||
this.params = params;
|
||||
@@ -27,6 +23,10 @@ class OctoKit {
|
||||
this.repoName = params.repo;
|
||||
this.repoOwner = params.owner;
|
||||
}
|
||||
get octokit() {
|
||||
numRequests++;
|
||||
return this._octokit;
|
||||
}
|
||||
getIssueByNumber(number) {
|
||||
return new OctoKitIssue(this.token, this.params, { number: number });
|
||||
}
|
||||
|
||||
@@ -1,183 +1,183 @@
|
||||
"use strict";
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See LICENSE in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.ActionBase = void 0;
|
||||
const utils_1 = require("./utils");
|
||||
class ActionBase {
|
||||
constructor(labels, milestoneName, milestoneId, ignoreLabels, ignoreMilestoneNames, ignoreMilestoneIds, minimumVotes, maximumVotes, involves) {
|
||||
this.labels = labels;
|
||||
this.milestoneName = milestoneName;
|
||||
this.milestoneId = milestoneId;
|
||||
this.ignoreLabels = ignoreLabels;
|
||||
this.ignoreMilestoneNames = ignoreMilestoneNames;
|
||||
this.ignoreMilestoneIds = ignoreMilestoneIds;
|
||||
this.minimumVotes = minimumVotes;
|
||||
this.maximumVotes = maximumVotes;
|
||||
this.involves = involves;
|
||||
this.labelsSet = [];
|
||||
this.ignoreLabelsSet = [];
|
||||
this.ignoreMilestoneNamesSet = [];
|
||||
this.ignoreMilestoneIdsSet = [];
|
||||
this.ignoreAllWithLabels = false;
|
||||
this.ignoreAllWithMilestones = false;
|
||||
this.involvesSet = [];
|
||||
}
|
||||
buildQuery(baseQuery) {
|
||||
var _a, _b, _c, _d, _e, _f;
|
||||
let query = baseQuery;
|
||||
(0, utils_1.safeLog)(`labels: ${this.labels}`);
|
||||
(0, utils_1.safeLog)(`milestoneName: ${this.milestoneName}`);
|
||||
(0, utils_1.safeLog)(`milestoneId: ${this.milestoneId}`);
|
||||
(0, utils_1.safeLog)(`ignoreLabels: ${this.ignoreLabels}`);
|
||||
(0, utils_1.safeLog)(`ignoreMilestoneNames: ${this.ignoreMilestoneNames}`);
|
||||
(0, utils_1.safeLog)(`ignoreMilestoneIds: ${this.ignoreMilestoneIds}`);
|
||||
(0, utils_1.safeLog)(`minimumVotes: ${this.minimumVotes}`);
|
||||
(0, utils_1.safeLog)(`maximumVotes: ${this.maximumVotes}`);
|
||||
(0, utils_1.safeLog)(`involves: ${this.involves}`);
|
||||
// Both milestone name and milestone Id must be provided and must match.
|
||||
// The name is used to construct the query, which does not accept ID.
|
||||
// The ID is used for comparisons with issue data, which does not include the name.
|
||||
// TODO: Figure out a way to convert either from milestone name to ID, or vice versa.
|
||||
// If label inclusion and exclusion are mixed, exclusion will take precedence.
|
||||
// For example, an issue with both labels A and B will not match if B is excluded, even if A is included.
|
||||
// If a milestoneName/milestoneId are set, ignoreMilenameName/ignoreMilestoneIds are ignored.
|
||||
// GitHub does not appear to support searching for all issues with milestones (not lacking a milestone). "-no:milestone" does not work.
|
||||
// GitHub does not appear to support searching for all issues with labels (not lacking a label). "-no:label" does not work.
|
||||
// All indicated labels must be present
|
||||
if (this.labels) {
|
||||
if (((_a = this.labels) === null || _a === void 0 ? void 0 : _a.length) > 2 && ((_b = this.labels) === null || _b === void 0 ? void 0 : _b.startsWith('"')) && ((_c = this.labels) === null || _c === void 0 ? void 0 : _c.endsWith('"'))) {
|
||||
this.labels = this.labels.substring(1, this.labels.length - 2);
|
||||
}
|
||||
this.labelsSet = (_d = this.labels) === null || _d === void 0 ? void 0 : _d.split(',');
|
||||
for (const str of this.labelsSet) {
|
||||
if (str != "") {
|
||||
query = query.concat(` label:"${str}"`);
|
||||
}
|
||||
}
|
||||
}
|
||||
// The "involves" qualifier to find issues that in some way involve a certain user.
|
||||
// It is a logical OR between the author, assignee, and mentions.
|
||||
if (this.involves) {
|
||||
this.involvesSet = (_e = this.involves) === null || _e === void 0 ? void 0 : _e.split(',');
|
||||
for (const str of this.involvesSet) {
|
||||
if (str != "") {
|
||||
query = query.concat(` involves:"${str}"`);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (this.ignoreLabels) {
|
||||
if (this.ignoreLabels == "*" && !this.labels) { // only if unlabeled
|
||||
query = query.concat(` no:label`);
|
||||
this.ignoreAllWithLabels = true;
|
||||
}
|
||||
else {
|
||||
this.ignoreLabelsSet = (_f = this.ignoreLabels) === null || _f === void 0 ? void 0 : _f.split(',');
|
||||
for (const str of this.ignoreLabelsSet) {
|
||||
if (str != "") {
|
||||
query = query.concat(` -label:"${str}"`);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (this.milestoneName) {
|
||||
query = query.concat(` milestone:"${this.milestoneName}"`);
|
||||
}
|
||||
else if (this.ignoreMilestoneNames) {
|
||||
if (this.ignoreMilestoneNames == "*") {
|
||||
query = query.concat(` no:milestone`);
|
||||
this.ignoreAllWithMilestones = true;
|
||||
}
|
||||
else if (this.ignoreMilestoneIds) {
|
||||
this.ignoreMilestoneNamesSet = this.ignoreMilestoneNames.split(',');
|
||||
this.ignoreMilestoneIdsSet = this.ignoreMilestoneIds.split(',');
|
||||
for (const str of this.ignoreMilestoneNamesSet) {
|
||||
if (str != "") {
|
||||
query = query.concat(` -milestone:"${str}"`);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return query;
|
||||
}
|
||||
// This is necessary because GitHub sometimes returns incorrect results,
|
||||
// and because issues may get modified while we are processing them.
|
||||
validateIssue(issue) {
|
||||
var _a, _b;
|
||||
if (this.ignoreAllWithLabels) {
|
||||
// Validate that the issue does not have labels
|
||||
if (issue.labels && issue.labels.length !== 0) {
|
||||
(0, utils_1.safeLog)(`Issue ${issue.number} skipped due to label found after querying for no:label.`);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else {
|
||||
// Make sure all labels we wanted are present.
|
||||
if ((!issue.labels || issue.labels.length == 0) && this.labelsSet.length > 0) {
|
||||
(0, utils_1.safeLog)(`Issue ${issue.number} skipped due to not having a required label set. No labels found.`);
|
||||
return false;
|
||||
}
|
||||
for (const str of this.labelsSet) {
|
||||
if (!issue.labels.includes(str)) {
|
||||
(0, utils_1.safeLog)(`Issue ${issue.number} skipped due to not having a required label set.`);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
// Make sure no labels we wanted to ignore are present.
|
||||
if (issue.labels && issue.labels.length > 0) {
|
||||
for (const str of this.ignoreLabelsSet) {
|
||||
if (issue.labels.includes(str)) {
|
||||
(0, utils_1.safeLog)(`Issue ${issue.number} skipped due to having an ignore label set: ${str}`);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (this.ignoreAllWithMilestones) {
|
||||
// Validate that the issue does not have a milestone.
|
||||
if (issue.milestone) {
|
||||
(0, utils_1.safeLog)(`Issue ${issue.number} skipped due to milestone found after querying for no:milestone.`);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else {
|
||||
// Make sure milestone is present, if required.
|
||||
if (this.milestoneId != null && ((_a = issue.milestone) === null || _a === void 0 ? void 0 : _a.milestoneId) != +this.milestoneId) {
|
||||
(0, utils_1.safeLog)(`Issue ${issue.number} skipped due to not having required milsetone id ${this.milestoneId}. Had: ${(_b = issue.milestone) === null || _b === void 0 ? void 0 : _b.milestoneId}`);
|
||||
return false;
|
||||
}
|
||||
// Make sure a milestones we wanted to ignore is not present.
|
||||
if (issue.milestone && issue.milestone.milestoneId != null) {
|
||||
for (const str of this.ignoreMilestoneIdsSet) {
|
||||
if (issue.milestone.milestoneId == +str) {
|
||||
(0, utils_1.safeLog)(`Issue ${issue.number} skipped due to milestone ${issue.milestone.milestoneId} found in list of ignored milestone IDs.`);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// Verify the issue has a sufficient number of upvotes
|
||||
let upvotes = 0;
|
||||
if (issue.reactions) {
|
||||
upvotes = issue.reactions['+1'];
|
||||
}
|
||||
if (this.minimumVotes != undefined) {
|
||||
if (upvotes < this.minimumVotes) {
|
||||
(0, utils_1.safeLog)(`Issue ${issue.number} skipped due to not having at least ${this.minimumVotes} upvotes. Had: ${upvotes}`);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
// Verify the issue does not have too many upvotes
|
||||
if (this.maximumVotes != undefined) {
|
||||
if (upvotes > this.maximumVotes) {
|
||||
(0, utils_1.safeLog)(`Issue ${issue.number} skipped due to having more than ${this.maximumVotes} upvotes. Had: ${upvotes}`);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
exports.ActionBase = ActionBase;
|
||||
"use strict";
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See LICENSE in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.ActionBase = void 0;
|
||||
const utils_1 = require("./utils");
|
||||
class ActionBase {
|
||||
constructor(labels, milestoneName, milestoneId, ignoreLabels, ignoreMilestoneNames, ignoreMilestoneIds, minimumVotes, maximumVotes, involves) {
|
||||
this.labels = labels;
|
||||
this.milestoneName = milestoneName;
|
||||
this.milestoneId = milestoneId;
|
||||
this.ignoreLabels = ignoreLabels;
|
||||
this.ignoreMilestoneNames = ignoreMilestoneNames;
|
||||
this.ignoreMilestoneIds = ignoreMilestoneIds;
|
||||
this.minimumVotes = minimumVotes;
|
||||
this.maximumVotes = maximumVotes;
|
||||
this.involves = involves;
|
||||
this.labelsSet = [];
|
||||
this.ignoreLabelsSet = [];
|
||||
this.ignoreMilestoneNamesSet = [];
|
||||
this.ignoreMilestoneIdsSet = [];
|
||||
this.ignoreAllWithLabels = false;
|
||||
this.ignoreAllWithMilestones = false;
|
||||
this.involvesSet = [];
|
||||
}
|
||||
buildQuery(baseQuery) {
|
||||
var _a, _b, _c, _d, _e, _f;
|
||||
let query = baseQuery;
|
||||
(0, utils_1.safeLog)(`labels: ${this.labels}`);
|
||||
(0, utils_1.safeLog)(`milestoneName: ${this.milestoneName}`);
|
||||
(0, utils_1.safeLog)(`milestoneId: ${this.milestoneId}`);
|
||||
(0, utils_1.safeLog)(`ignoreLabels: ${this.ignoreLabels}`);
|
||||
(0, utils_1.safeLog)(`ignoreMilestoneNames: ${this.ignoreMilestoneNames}`);
|
||||
(0, utils_1.safeLog)(`ignoreMilestoneIds: ${this.ignoreMilestoneIds}`);
|
||||
(0, utils_1.safeLog)(`minimumVotes: ${this.minimumVotes}`);
|
||||
(0, utils_1.safeLog)(`maximumVotes: ${this.maximumVotes}`);
|
||||
(0, utils_1.safeLog)(`involves: ${this.involves}`);
|
||||
// Both milestone name and milestone Id must be provided and must match.
|
||||
// The name is used to construct the query, which does not accept ID.
|
||||
// The ID is used for comparisons with issue data, which does not include the name.
|
||||
// TODO: Figure out a way to convert either from milestone name to ID, or vice versa.
|
||||
// If label inclusion and exclusion are mixed, exclusion will take precedence.
|
||||
// For example, an issue with both labels A and B will not match if B is excluded, even if A is included.
|
||||
// If a milestoneName/milestoneId are set, ignoreMilenameName/ignoreMilestoneIds are ignored.
|
||||
// GitHub does not appear to support searching for all issues with milestones (not lacking a milestone). "-no:milestone" does not work.
|
||||
// GitHub does not appear to support searching for all issues with labels (not lacking a label). "-no:label" does not work.
|
||||
// All indicated labels must be present
|
||||
if (this.labels) {
|
||||
if (((_a = this.labels) === null || _a === void 0 ? void 0 : _a.length) > 2 && ((_b = this.labels) === null || _b === void 0 ? void 0 : _b.startsWith('"')) && ((_c = this.labels) === null || _c === void 0 ? void 0 : _c.endsWith('"'))) {
|
||||
this.labels = this.labels.substring(1, this.labels.length - 2);
|
||||
}
|
||||
this.labelsSet = (_d = this.labels) === null || _d === void 0 ? void 0 : _d.split(',');
|
||||
for (const str of this.labelsSet) {
|
||||
if (str != "") {
|
||||
query = query.concat(` label:"${str}"`);
|
||||
}
|
||||
}
|
||||
}
|
||||
// The "involves" qualifier to find issues that in some way involve a certain user.
|
||||
// It is a logical OR between the author, assignee, and mentions.
|
||||
if (this.involves) {
|
||||
this.involvesSet = (_e = this.involves) === null || _e === void 0 ? void 0 : _e.split(',');
|
||||
for (const str of this.involvesSet) {
|
||||
if (str != "") {
|
||||
query = query.concat(` involves:"${str}"`);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (this.ignoreLabels) {
|
||||
if (this.ignoreLabels == "*" && !this.labels) { // only if unlabeled
|
||||
query = query.concat(` no:label`);
|
||||
this.ignoreAllWithLabels = true;
|
||||
}
|
||||
else {
|
||||
this.ignoreLabelsSet = (_f = this.ignoreLabels) === null || _f === void 0 ? void 0 : _f.split(',');
|
||||
for (const str of this.ignoreLabelsSet) {
|
||||
if (str != "") {
|
||||
query = query.concat(` -label:"${str}"`);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (this.milestoneName) {
|
||||
query = query.concat(` milestone:"${this.milestoneName}"`);
|
||||
}
|
||||
else if (this.ignoreMilestoneNames) {
|
||||
if (this.ignoreMilestoneNames == "*") {
|
||||
query = query.concat(` no:milestone`);
|
||||
this.ignoreAllWithMilestones = true;
|
||||
}
|
||||
else if (this.ignoreMilestoneIds) {
|
||||
this.ignoreMilestoneNamesSet = this.ignoreMilestoneNames.split(',');
|
||||
this.ignoreMilestoneIdsSet = this.ignoreMilestoneIds.split(',');
|
||||
for (const str of this.ignoreMilestoneNamesSet) {
|
||||
if (str != "") {
|
||||
query = query.concat(` -milestone:"${str}"`);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return query;
|
||||
}
|
||||
// This is necessary because GitHub sometimes returns incorrect results,
|
||||
// and because issues may get modified while we are processing them.
|
||||
validateIssue(issue) {
|
||||
var _a, _b;
|
||||
if (this.ignoreAllWithLabels) {
|
||||
// Validate that the issue does not have labels
|
||||
if (issue.labels && issue.labels.length !== 0) {
|
||||
(0, utils_1.safeLog)(`Issue ${issue.number} skipped due to label found after querying for no:label.`);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else {
|
||||
// Make sure all labels we wanted are present.
|
||||
if ((!issue.labels || issue.labels.length == 0) && this.labelsSet.length > 0) {
|
||||
(0, utils_1.safeLog)(`Issue ${issue.number} skipped due to not having a required label set. No labels found.`);
|
||||
return false;
|
||||
}
|
||||
for (const str of this.labelsSet) {
|
||||
if (!issue.labels.includes(str)) {
|
||||
(0, utils_1.safeLog)(`Issue ${issue.number} skipped due to not having a required label set.`);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
// Make sure no labels we wanted to ignore are present.
|
||||
if (issue.labels && issue.labels.length > 0) {
|
||||
for (const str of this.ignoreLabelsSet) {
|
||||
if (issue.labels.includes(str)) {
|
||||
(0, utils_1.safeLog)(`Issue ${issue.number} skipped due to having an ignore label set: ${str}`);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (this.ignoreAllWithMilestones) {
|
||||
// Validate that the issue does not have a milestone.
|
||||
if (issue.milestone) {
|
||||
(0, utils_1.safeLog)(`Issue ${issue.number} skipped due to milestone found after querying for no:milestone.`);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else {
|
||||
// Make sure milestone is present, if required.
|
||||
if (this.milestoneId != null && ((_a = issue.milestone) === null || _a === void 0 ? void 0 : _a.milestoneId) != +this.milestoneId) {
|
||||
(0, utils_1.safeLog)(`Issue ${issue.number} skipped due to not having required milsetone id ${this.milestoneId}. Had: ${(_b = issue.milestone) === null || _b === void 0 ? void 0 : _b.milestoneId}`);
|
||||
return false;
|
||||
}
|
||||
// Make sure a milestones we wanted to ignore is not present.
|
||||
if (issue.milestone && issue.milestone.milestoneId != null) {
|
||||
for (const str of this.ignoreMilestoneIdsSet) {
|
||||
if (issue.milestone.milestoneId == +str) {
|
||||
(0, utils_1.safeLog)(`Issue ${issue.number} skipped due to milestone ${issue.milestone.milestoneId} found in list of ignored milestone IDs.`);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// Verify the issue has a sufficient number of upvotes
|
||||
let upvotes = 0;
|
||||
if (issue.reactions) {
|
||||
upvotes = issue.reactions['+1'];
|
||||
}
|
||||
if (this.minimumVotes != undefined) {
|
||||
if (upvotes < this.minimumVotes) {
|
||||
(0, utils_1.safeLog)(`Issue ${issue.number} skipped due to not having at least ${this.minimumVotes} upvotes. Had: ${upvotes}`);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
// Verify the issue does not have too many upvotes
|
||||
if (this.maximumVotes != undefined) {
|
||||
if (upvotes > this.maximumVotes) {
|
||||
(0, utils_1.safeLog)(`Issue ${issue.number} skipped due to having more than ${this.maximumVotes} upvotes. Had: ${upvotes}`);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
exports.ActionBase = ActionBase;
|
||||
//# sourceMappingURL=ActionBase.js.map
|
||||
@@ -25,6 +25,7 @@ export const normalizeIssue = (issue: {
|
||||
const cleanse = (str: string) => {
|
||||
let out = str
|
||||
.toLowerCase()
|
||||
.replace(/<!--.*-->/gu, '')
|
||||
.replace(/.* version: .*/gu, '')
|
||||
.replace(/issue type: .*/gu, '')
|
||||
.replace(/vs ?code/gu, '')
|
||||
@@ -35,12 +36,6 @@ export const normalizeIssue = (issue: {
|
||||
.replace(/\s+/gu, ' ')
|
||||
.replace(/```[^`]*?```/gu, '');
|
||||
|
||||
while (
|
||||
out.includes('<!--') &&
|
||||
out.includes('-->') &&
|
||||
out.indexOf('-->') > out.indexOf('<!--')) {
|
||||
out = out.slice(0, out.indexOf('<!--')) + out.slice(out.indexOf('-->') + 3);
|
||||
}
|
||||
while (
|
||||
out.includes(`<details>`) &&
|
||||
out.includes('</details>') &&
|
||||
@@ -121,9 +116,9 @@ Repo: ${context.repo.owner}/${context.repo.repo}
|
||||
|
||||
<!-- Context:
|
||||
${JSON.stringify(context, null, 2)
|
||||
.replace(/<!--/gu, '<@--')
|
||||
.replace(/--!?\s*>/gu, '--@>')
|
||||
.replace(/\/|\\/gu, 'slash-')}
|
||||
.replace(/<!--/gu, '<@--')
|
||||
.replace(/-->/gu, '--@>')
|
||||
.replace(/\/|\\/gu, 'slash-')}
|
||||
-->
|
||||
`);
|
||||
};
|
||||
|
||||
Generated
+3003
-3037
File diff suppressed because it is too large
Load Diff
@@ -10,12 +10,13 @@
|
||||
"keywords": [],
|
||||
"author": "",
|
||||
"dependencies": {
|
||||
"@actions/core": "^2.0.3",
|
||||
"@actions/github": "^8.0.1",
|
||||
"@octokit/rest": "^21.1.1",
|
||||
"@actions/core": "^1.9.1",
|
||||
"@actions/github": "^5.0.3",
|
||||
"@octokit/rest": "^19.0.3",
|
||||
"@slack/web-api": "^6.9.1",
|
||||
"axios": "^1.16.0",
|
||||
"uuid": "^14.0.0"
|
||||
"applicationinsights": "^2.5.1",
|
||||
"axios": "^1.6.1",
|
||||
"uuid": "^8.3.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@azure/storage-blob": "^12.13.0",
|
||||
@@ -38,9 +39,7 @@
|
||||
"typescript": "^4.7.4",
|
||||
"yargs": "^17.5.1"
|
||||
},
|
||||
"overrides": {
|
||||
"serialize-javascript": "^7.0.5",
|
||||
"flatted": "^3.4.2",
|
||||
"fast-xml-parser": "^5.5.7"
|
||||
"resolutions": {
|
||||
"minimatch": "^3.0.5"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
version: 2
|
||||
updates:
|
||||
- package-ecosystem: "github-actions"
|
||||
directory: "/"
|
||||
groups:
|
||||
github-actions:
|
||||
patterns: ["*"]
|
||||
schedule:
|
||||
interval: "weekly"
|
||||
cooldown:
|
||||
default-days: 7
|
||||
@@ -1,33 +0,0 @@
|
||||
name: Bug - debugger
|
||||
on:
|
||||
schedule:
|
||||
- cron: 50 12 * * * # Run at 12:50 PM UTC (4:50 AM PST, 5:50 AM PDT)
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
readonly:
|
||||
description: "readonly: Specify true or 1 to prevent changes from being commited to GitHub"
|
||||
default: false
|
||||
|
||||
env:
|
||||
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
|
||||
|
||||
jobs:
|
||||
main:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
issues: write
|
||||
steps:
|
||||
- name: Checkout Actions
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
- name: Install Actions
|
||||
run: cd ./.github/actions && npm install --production && cd ../..
|
||||
- name: Add Comment
|
||||
uses: ./.github/actions/AddComment
|
||||
with:
|
||||
readonly: ${{ github.event.inputs.readonly }}
|
||||
labels: bug,debugger
|
||||
ignoreLabels: "investigate: costing,investigate,external,by design,question,more info needed,Language Service,internal"
|
||||
createdAfter: "2024-07-22"
|
||||
addComment: "Thank you for reporting this issue. We’ll let you know if we need more information to investigate it. Additionally, if you're working with GDB/LLDB, please note that the code is open source at https://github.com/microsoft/MIEngine/wiki/Contributing-Code . Your contributions are always welcome and appreciated."
|
||||
addLabels: help wanted
|
||||
|
||||
+3
-9
@@ -1,24 +1,19 @@
|
||||
name: By Design closer - debugger
|
||||
on:
|
||||
schedule:
|
||||
- cron: 0 13 * * * # Run at 1:00 PM UTC (5:00 AM PST, 6:00 AM PDT)
|
||||
- cron: 10 11 * * * # Run at 11:10 AM UTC (3:10 AM PST, 4:10 AM PDT)
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
readonly:
|
||||
description: "readonly: Specify true or 1 to prevent changes from being commited to GitHub"
|
||||
default: false
|
||||
|
||||
env:
|
||||
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
|
||||
|
||||
jobs:
|
||||
main:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
issues: write
|
||||
steps:
|
||||
- name: Checkout Actions
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
uses: actions/checkout@v3
|
||||
- name: Install Actions
|
||||
run: cd ./.github/actions && npm install --production && cd ../..
|
||||
- name: Stale Closer
|
||||
@@ -26,7 +21,6 @@ jobs:
|
||||
with:
|
||||
readonly: ${{ github.event.inputs.readonly }}
|
||||
labels: by design,debugger
|
||||
ignoreLabels: Language Service,internal
|
||||
ignoreLabels: language service,internal
|
||||
closeDays: 0
|
||||
closeComment: "This issue has been closed because the described behavior was determined to be by design."
|
||||
|
||||
@@ -8,17 +8,12 @@ on:
|
||||
description: "readonly: Specify true or 1 to prevent changes from being commited to GitHub"
|
||||
default: false
|
||||
|
||||
env:
|
||||
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
|
||||
|
||||
jobs:
|
||||
main:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
issues: write
|
||||
steps:
|
||||
- name: Checkout Actions
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
uses: actions/checkout@v3
|
||||
- name: Install Actions
|
||||
run: cd ./.github/actions && npm install --production && cd ../..
|
||||
- name: Stale Closer
|
||||
@@ -31,4 +26,3 @@ jobs:
|
||||
closeComment: "This issue has been closed because the described behavior was determined to be by design."
|
||||
pingDays: 80
|
||||
pingComment: "Hey @${assignee}, this issue might need further attention.\n\n@${author}, you can help us out by closing this issue if it is no longer relevant."
|
||||
|
||||
|
||||
@@ -5,20 +5,10 @@ on:
|
||||
branches: [ main ]
|
||||
pull_request:
|
||||
branches: [ main ]
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
target-ref:
|
||||
description: Branch, tag, or SHA to test
|
||||
required: true
|
||||
default: main
|
||||
|
||||
env:
|
||||
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
|
||||
|
||||
jobs:
|
||||
job:
|
||||
uses: ./.github/workflows/job-compile-and-test.yml
|
||||
with:
|
||||
runner-env: ubuntu-24.04
|
||||
platform: linux
|
||||
checkout-ref: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.target-ref || github.ref }}
|
||||
runner-env: ubuntu-22.04
|
||||
platform: linux
|
||||
@@ -5,22 +5,11 @@ on:
|
||||
branches: [ main ]
|
||||
pull_request:
|
||||
branches: [ main ]
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
target-ref:
|
||||
description: Branch, tag, or SHA to test
|
||||
required: true
|
||||
default: main
|
||||
|
||||
env:
|
||||
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
|
||||
|
||||
jobs:
|
||||
job:
|
||||
uses: ./.github/workflows/job-compile-and-test.yml
|
||||
with:
|
||||
runner-env: macos-15
|
||||
runner-env: macos-12
|
||||
platform: mac
|
||||
checkout-ref: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.target-ref || github.ref }}
|
||||
yarn-args: --network-timeout 100000
|
||||
|
||||
yarn-args: --network-timeout 100000
|
||||
@@ -5,20 +5,10 @@ on:
|
||||
branches: [ main ]
|
||||
pull_request:
|
||||
branches: [ main ]
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
target-ref:
|
||||
description: Branch, tag, or SHA to test
|
||||
required: true
|
||||
default: main
|
||||
|
||||
env:
|
||||
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
|
||||
|
||||
jobs:
|
||||
job:
|
||||
uses: ./.github/workflows/job-compile-and-test.yml
|
||||
with:
|
||||
runner-env: windows-2025
|
||||
runner-env: windows-2022
|
||||
platform: windows
|
||||
checkout-ref: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.target-ref || github.ref }}
|
||||
|
||||
@@ -1,97 +0,0 @@
|
||||
# For most projects, this workflow file will not need changing; you simply need
|
||||
# to commit it to your repository.
|
||||
#
|
||||
# You may wish to alter this file to override the set of languages analyzed,
|
||||
# or to provide custom queries or build logic.
|
||||
#
|
||||
# ******** NOTE ********
|
||||
# We have attempted to detect the languages in your repository. Please check
|
||||
# the `language` matrix defined below to confirm you have the correct set of
|
||||
# supported CodeQL languages.
|
||||
#
|
||||
name: "CodeQL"
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ "main", "insiders", "release", "vs" ]
|
||||
pull_request:
|
||||
branches: [ "main", "insiders", "release", "vs" ]
|
||||
schedule:
|
||||
- cron: '29 4 * * 3'
|
||||
|
||||
env:
|
||||
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
|
||||
|
||||
jobs:
|
||||
analyze:
|
||||
name: Analyze (${{ matrix.language }})
|
||||
# Runner size impacts CodeQL analysis time. To learn more, please see:
|
||||
# - https://gh.io/recommended-hardware-resources-for-running-codeql
|
||||
# - https://gh.io/supported-runners-and-hardware-resources
|
||||
# - https://gh.io/using-larger-runners (GitHub.com only)
|
||||
# Consider using larger runners or machines with greater resources for possible analysis time improvements.
|
||||
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
|
||||
timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }}
|
||||
permissions:
|
||||
# required for all workflows
|
||||
security-events: write
|
||||
|
||||
# required to fetch internal or private CodeQL packs
|
||||
packages: read
|
||||
|
||||
# only required for workflows in private repositories
|
||||
actions: read
|
||||
contents: read
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- language: javascript-typescript
|
||||
build-mode: none
|
||||
# CodeQL supports the following values keywords for 'language': 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift'
|
||||
# Use `c-cpp` to analyze code written in C, C++ or both
|
||||
# Use 'java-kotlin' to analyze code written in Java, Kotlin or both
|
||||
# Use 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
|
||||
# To learn more about changing the languages that are analyzed or customizing the build mode for your analysis,
|
||||
# see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning.
|
||||
# If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how
|
||||
# your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
|
||||
# Initializes the CodeQL tools for scanning.
|
||||
- name: Initialize CodeQL
|
||||
uses: github/codeql-action/init@f205ea1c3313d32999d8d6a48b4f6530d4437b38 # v4.37.4
|
||||
with:
|
||||
languages: ${{ matrix.language }}
|
||||
build-mode: ${{ matrix.build-mode }}
|
||||
# If you wish to specify custom queries, you can do so here or in a config file.
|
||||
# By default, queries listed here will override any specified in a config file.
|
||||
# Prefix the list here with "+" to use these queries and those in the config file.
|
||||
|
||||
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
|
||||
# queries: security-extended,security-and-quality
|
||||
|
||||
# If the analyze step fails for one of the languages you are analyzing with
|
||||
# "We were unable to automatically build your code", modify the matrix above
|
||||
# to set the build mode to "manual" for that language. Then modify this step
|
||||
# to build your code.
|
||||
# ℹ️ Command-line programs to run using the OS shell.
|
||||
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
|
||||
- if: matrix.build-mode == 'manual'
|
||||
shell: bash
|
||||
run: |
|
||||
echo 'If you are using a "manual" build mode for one or more of the' \
|
||||
'languages you are analyzing, replace this with the commands to build' \
|
||||
'your code, for example:'
|
||||
echo ' make bootstrap'
|
||||
echo ' make release'
|
||||
exit 1
|
||||
|
||||
- name: Perform CodeQL Analysis
|
||||
uses: github/codeql-action/analyze@f205ea1c3313d32999d8d6a48b4f6530d4437b38 # v4.37.4
|
||||
with:
|
||||
category: "/language:${{matrix.language}}"
|
||||
|
||||
@@ -8,17 +8,12 @@ on:
|
||||
description: "readonly: Specify true or 1 to prevent changes from being commited to GitHub"
|
||||
default: false
|
||||
|
||||
env:
|
||||
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
|
||||
|
||||
jobs:
|
||||
main:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
issues: write
|
||||
steps:
|
||||
- name: Checkout Actions
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
uses: actions/checkout@v2
|
||||
- name: Install Actions
|
||||
run: cd ./.github/actions && npm install --production && cd ../..
|
||||
- name: Stale Closer
|
||||
@@ -31,4 +26,3 @@ jobs:
|
||||
closeComment: "This issue has been closed because it is a duplicate of another issue we are tracking."
|
||||
pingDays: 80
|
||||
pingComment: "Hey @${assignee}, this issue might need further attention.\n\n@${author}, you can help us out by closing this issue if it is no longer relevant."
|
||||
|
||||
|
||||
@@ -1,24 +1,19 @@
|
||||
name: Enhancement Closer (no milestone)
|
||||
on:
|
||||
schedule:
|
||||
- cron: 40 12 * * * # Run at 12:40 PM UTC (4:40 AM PST, 5:40 AM PDT)
|
||||
- cron: 50 11 * * * # Run at 11:50 AM UTC (3:50 AM PST, 4:50 AM PDT)
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
readonly:
|
||||
description: "readonly: Specify true or 1 to prevent changes from being commited to GitHub"
|
||||
default: false
|
||||
|
||||
env:
|
||||
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
|
||||
|
||||
jobs:
|
||||
main:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
issues: write
|
||||
steps:
|
||||
- name: Checkout Actions
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
uses: actions/checkout@v2
|
||||
- name: Install Actions
|
||||
run: cd ./.github/actions && npm install --production && cd ../..
|
||||
- name: Stale Closer
|
||||
@@ -33,4 +28,3 @@ jobs:
|
||||
closeComment: "This feature request is being closed due to insufficient upvotes. Please leave a 👍-upvote or 👎-downvote reaction on the issue to help us prioritize it. When enough upvotes are received, this issue will be eligible for our backlog."
|
||||
setMilestoneId: 30
|
||||
ignoreMilestoneNames: "*"
|
||||
|
||||
|
||||
@@ -1,24 +1,19 @@
|
||||
name: Enhancement Closer (Triage)
|
||||
on:
|
||||
schedule:
|
||||
- cron: 30 12 * * * # Run at 12:30 PM UTC (4:30 AM PST, 5:30 AM PDT)
|
||||
- cron: 40 11 * * * # Run at 11:40 AM UTC (3:40 AM PST, 4:40 AM PDT)
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
readonly:
|
||||
description: "readonly: Specify true or 1 to prevent changes from being commited to GitHub"
|
||||
default: false
|
||||
|
||||
env:
|
||||
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
|
||||
|
||||
jobs:
|
||||
main:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
issues: write
|
||||
steps:
|
||||
- name: Checkout Actions
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
uses: actions/checkout@v2
|
||||
- name: Install Actions
|
||||
run: cd ./.github/actions && npm install --production && cd ../..
|
||||
- name: Stale Closer
|
||||
@@ -33,4 +28,3 @@ jobs:
|
||||
closeComment: "This feature request is being closed due to insufficient upvotes. Please leave a 👍-upvote or 👎-downvote reaction on the issue to help us prioritize it. When enough upvotes are received, this issue will be eligible for our backlog."
|
||||
milestoneName: Triage
|
||||
milestoneId: 30
|
||||
|
||||
|
||||
@@ -1,24 +1,19 @@
|
||||
name: Enhancement Reopener
|
||||
on:
|
||||
schedule:
|
||||
- cron: 0 11 * * * # Run at 11:00 AM UTC (3:00 AM PST, 4:00 AM PDT)
|
||||
- cron: 20 12 * * * # Run at 12:20 PM UTC (4:20 AM PST, 5:20 AM PDT)
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
readonly:
|
||||
description: "readonly: Specify true or 1 to prevent changes from being commited to GitHub"
|
||||
default: false
|
||||
|
||||
env:
|
||||
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
|
||||
|
||||
jobs:
|
||||
main:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
issues: write
|
||||
steps:
|
||||
- name: Checkout Actions
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
uses: actions/checkout@v2
|
||||
- name: Install Actions
|
||||
run: cd ./.github/actions && npm install --production && cd ../..
|
||||
- name: Run Reopener
|
||||
@@ -34,4 +29,3 @@ jobs:
|
||||
milestoneName: Triage
|
||||
setMilestoneId: 28
|
||||
removeLabels: more votes needed
|
||||
|
||||
|
||||
@@ -1,24 +1,19 @@
|
||||
name: External closer - debugger
|
||||
on:
|
||||
schedule:
|
||||
- cron: 10 13 * * * # Run at 1:10 PM UTC (5:10 AM PST, 6:10 AM PDT)
|
||||
- cron: 10 11 * * * # Run at 11:10 AM UTC (3:10 AM PST, 4:10 AM PDT)
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
readonly:
|
||||
description: "readonly: Specify true or 1 to prevent changes from being commited to GitHub"
|
||||
default: false
|
||||
|
||||
env:
|
||||
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
|
||||
|
||||
jobs:
|
||||
main:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
issues: write
|
||||
steps:
|
||||
- name: Checkout Actions
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
uses: actions/checkout@v2
|
||||
- name: Install Actions
|
||||
run: cd ./.github/actions && npm install --production && cd ../..
|
||||
- name: Stale Closer
|
||||
@@ -26,7 +21,6 @@ jobs:
|
||||
with:
|
||||
readonly: ${{ github.event.inputs.readonly }}
|
||||
labels: external,debugger
|
||||
ignoreLabels: Language Service,internal
|
||||
ignoreLabels: language service,internal
|
||||
closeDays: 0
|
||||
closeComment: "This issue has been closed because it is external or not applicable to the extension."
|
||||
|
||||
|
||||
@@ -8,17 +8,12 @@ on:
|
||||
description: "readonly: Specify true or 1 to prevent changes from being commited to GitHub"
|
||||
default: false
|
||||
|
||||
env:
|
||||
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
|
||||
|
||||
jobs:
|
||||
main:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
issues: write
|
||||
steps:
|
||||
- name: Checkout Actions
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
uses: actions/checkout@v2
|
||||
- name: Install Actions
|
||||
run: cd ./.github/actions && npm install --production && cd ../..
|
||||
- name: Stale Closer
|
||||
@@ -33,4 +28,3 @@ jobs:
|
||||
closeComment: "This feature request is being closed due to insufficient upvotes. Please leave a 👍-upvote or 👎-downvote reaction on the issue to help us prioritize it. When enough upvotes are received, this issue will be eligible for our backlog."
|
||||
setMilestoneId: 30
|
||||
ignoreMilestoneNames: "*"
|
||||
|
||||
|
||||
@@ -8,17 +8,12 @@ on:
|
||||
description: "readonly: Specify true or 1 to prevent changes from being commited to GitHub"
|
||||
default: false
|
||||
|
||||
env:
|
||||
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
|
||||
|
||||
jobs:
|
||||
main:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
issues: write
|
||||
steps:
|
||||
- name: Checkout Actions
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
uses: actions/checkout@v2
|
||||
- name: Install Actions
|
||||
run: cd ./.github/actions && npm install --production && cd ../..
|
||||
- name: Stale Closer
|
||||
@@ -33,4 +28,3 @@ jobs:
|
||||
closeComment: "This feature request is being closed due to insufficient upvotes. Please leave a 👍-upvote or 👎-downvote reaction on the issue to help us prioritize it. When enough upvotes are received, this issue will be eligible for our backlog."
|
||||
milestoneName: Triage
|
||||
milestoneId: 30
|
||||
|
||||
|
||||
@@ -1,33 +0,0 @@
|
||||
name: Feature Request - debugger
|
||||
on:
|
||||
schedule:
|
||||
- cron: 20 13 * * * # Run at 1:20 PM UTC (5:20 AM PST, 6:20 AM PDT)
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
readonly:
|
||||
description: "readonly: Specify true or 1 to prevent changes from being commited to GitHub"
|
||||
default: false
|
||||
|
||||
env:
|
||||
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
|
||||
|
||||
jobs:
|
||||
main:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
issues: write
|
||||
steps:
|
||||
- name: Checkout Actions
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
- name: Install Actions
|
||||
run: cd ./.github/actions && npm install --production && cd ../..
|
||||
- name: Add Comment
|
||||
uses: ./.github/actions/AddComment
|
||||
with:
|
||||
readonly: ${{ github.event.inputs.readonly }}
|
||||
labels: Feature Request,debugger
|
||||
ignoreLabels: "investigate: costing,investigate,external,by design,question,more info needed,Language Service,internal"
|
||||
createdAfter: "2024-07-22"
|
||||
addComment: "Thank you for your feature request. While we may not be able to implement it immediately, we will monitor community reactions to see how it fits into our backlog. Additionally, if you're working with GDB/LLDB, please note that the code is open source at https://github.com/microsoft/MIEngine/wiki/Contributing-Code . Your contributions are always welcome and appreciated."
|
||||
addLabels: help wanted
|
||||
|
||||
@@ -8,17 +8,12 @@ on:
|
||||
description: "readonly: Specify true or 1 to prevent changes from being commited to GitHub"
|
||||
default: false
|
||||
|
||||
env:
|
||||
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
|
||||
|
||||
jobs:
|
||||
main:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
issues: write
|
||||
steps:
|
||||
- name: Checkout Actions
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
uses: actions/checkout@v2
|
||||
- name: Install Actions
|
||||
run: cd ./.github/actions && npm install --production && cd ../..
|
||||
- name: Run Reopener
|
||||
@@ -34,4 +29,3 @@ jobs:
|
||||
milestoneName: Triage
|
||||
setMilestoneId: 28
|
||||
removeLabels: more votes needed
|
||||
|
||||
|
||||
@@ -1,24 +1,19 @@
|
||||
name: Investigate closer - debugger
|
||||
on:
|
||||
schedule:
|
||||
- cron: 30 13 * * * # Run at 1:30 PM UTC (5:30 AM PST, 6:30 AM PDT)
|
||||
- cron: 10 11 * * * # Run at 11:10 AM UTC (3:10 AM PST, 4:10 AM PDT)
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
readonly:
|
||||
description: "readonly: Specify true or 1 to prevent changes from being commited to GitHub"
|
||||
default: false
|
||||
|
||||
env:
|
||||
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
|
||||
|
||||
jobs:
|
||||
main:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
issues: write
|
||||
steps:
|
||||
- name: Checkout Actions
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
uses: actions/checkout@v2
|
||||
- name: Install Actions
|
||||
run: cd ./.github/actions && npm install --production && cd ../..
|
||||
- name: Stale Closer
|
||||
@@ -26,7 +21,6 @@ jobs:
|
||||
with:
|
||||
readonly: ${{ github.event.inputs.readonly }}
|
||||
labels: investigate,debugger
|
||||
ignoreLabels: Language Service,internal
|
||||
ignoreLabels: language service,internal
|
||||
closeDays: 180
|
||||
closeComment: "This issue has been closed as lower priority. We're sorry if this issue still impacts you but unfortunately we're not able to address this. We will accept a pull request from the community if it's applicable for this issue."
|
||||
|
||||
|
||||
@@ -1,24 +1,19 @@
|
||||
name: Investigate Costing closer - debugger
|
||||
on:
|
||||
schedule:
|
||||
- cron: 40 13 * * * # Run at 1:40 PM UTC (5:40 AM PST, 6:40 AM PDT)
|
||||
- cron: 10 11 * * * # Run at 11:10 AM UTC (3:10 AM PST, 4:10 AM PDT)
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
readonly:
|
||||
description: "readonly: Specify true or 1 to prevent changes from being commited to GitHub"
|
||||
default: false
|
||||
|
||||
env:
|
||||
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
|
||||
|
||||
jobs:
|
||||
main:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
issues: write
|
||||
steps:
|
||||
- name: Checkout Actions
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
uses: actions/checkout@v2
|
||||
- name: Install Actions
|
||||
run: cd ./.github/actions && npm install --production && cd ../..
|
||||
- name: Stale Closer
|
||||
@@ -26,7 +21,6 @@ jobs:
|
||||
with:
|
||||
readonly: ${{ github.event.inputs.readonly }}
|
||||
labels: "investigate: costing,debugger"
|
||||
ignoreLabels: Language Service,internal
|
||||
ignoreLabels: language service,internal
|
||||
closeDays: 180
|
||||
closeComment: "This issue has been closed as lower priority. We're sorry if this issue still impacts you but unfortunately we're not able to address this. We will accept a pull request from the community if it's applicable for this issue."
|
||||
|
||||
|
||||
@@ -11,39 +11,25 @@ on:
|
||||
# Expects 'mac', 'linux', or 'windows'
|
||||
required: true
|
||||
type: string
|
||||
checkout-ref:
|
||||
required: false
|
||||
type: string
|
||||
yarn-args:
|
||||
type: string
|
||||
|
||||
env:
|
||||
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ${{ inputs.runner-env }}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
with:
|
||||
ref: ${{ inputs.checkout-ref }}
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Use Node.js 24
|
||||
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
|
||||
- name: Use Node.js 16
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 24
|
||||
node-version: 16
|
||||
|
||||
- name: Install Dependencies
|
||||
run: yarn install ${{ inputs.yarn-args }}
|
||||
working-directory: Extension
|
||||
|
||||
- name: Install gdb (linux)
|
||||
if: ${{ inputs.platform == 'linux' }}
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y gdb
|
||||
|
||||
- name: Compile Sources
|
||||
run: yarn run compile
|
||||
working-directory: Extension
|
||||
@@ -56,46 +42,32 @@ jobs:
|
||||
run: yarn test
|
||||
working-directory: Extension
|
||||
|
||||
- name: Acquire Native Binaries
|
||||
run: yarn install-and-copy-binaries-for-test
|
||||
working-directory: Extension
|
||||
# NOTE : We can't run the test that require the native binary files
|
||||
# yet -- there will be an update soon that allows the tester to
|
||||
# acquire them on-the-fly
|
||||
# - name: Run languageServer integration tests
|
||||
# if: ${{ inputs.platform == 'windows' }}
|
||||
# run: yarn test --scenario=SingleRootProject
|
||||
# working-directory: Extension
|
||||
|
||||
- name: Run languageServer integration tests (Windows)
|
||||
if: ${{ inputs.platform == 'windows' }}
|
||||
run: yarn test --scenario=SingleRootProject
|
||||
working-directory: Extension
|
||||
|
||||
- name: Run E2E IntelliSense features tests (Windows)
|
||||
if: ${{ inputs.platform == 'windows' }}
|
||||
run: yarn test --scenario=MultirootDeadlockTest
|
||||
working-directory: Extension
|
||||
|
||||
- name: Run RunWithoutDebugging tests (Windows)
|
||||
if: ${{ inputs.platform == 'windows' }}
|
||||
run: yarn test --scenario=RunWithoutDebugging
|
||||
working-directory: Extension
|
||||
# - name: Run E2E IntelliSense features tests
|
||||
# if: ${{ inputs.platform == 'windows' }}
|
||||
# run: yarn test --scenario=MultirootDeadlockTest
|
||||
# working-directory: Extension
|
||||
|
||||
# NOTE: For mac/linux run the tests with xvfb-action for UI support.
|
||||
# Another way to start xvfb https://github.com/microsoft/vscode-test/blob/master/sample/azure-pipelines.yml
|
||||
|
||||
- name: Run languageServer integration tests (linux/macOS)
|
||||
if: ${{ inputs.platform == 'mac' || inputs.platform == 'linux' }}
|
||||
uses: coactions/setup-xvfb@b6b4fcfb9f5a895edadc3bc76318fae0ac17c8b3 # v1.0.1
|
||||
with:
|
||||
run: yarn test --scenario=SingleRootProject
|
||||
working-directory: Extension
|
||||
|
||||
- name: Run E2E IntelliSense features tests (linux/macOS)
|
||||
if: ${{ inputs.platform == 'mac' || inputs.platform == 'linux' }}
|
||||
uses: coactions/setup-xvfb@b6b4fcfb9f5a895edadc3bc76318fae0ac17c8b3 # v1.0.1
|
||||
with:
|
||||
run: yarn test --scenario=MultirootDeadlockTest
|
||||
working-directory: Extension
|
||||
|
||||
- name: Run RunWithoutDebugging tests (linux/macOS)
|
||||
if: ${{ inputs.platform == 'mac' || inputs.platform == 'linux' }}
|
||||
uses: coactions/setup-xvfb@b6b4fcfb9f5a895edadc3bc76318fae0ac17c8b3 # v1.0.1
|
||||
with:
|
||||
run: yarn test --scenario=RunWithoutDebugging --scenario-arg=skipExternalConsole
|
||||
working-directory: Extension
|
||||
# - name: Run languageServer integration tests (xvfb)
|
||||
# if: ${{ inputs.platform == 'mac' || inputs.platform == 'linux' }}
|
||||
# uses: coactions/setup-xvfb@v1
|
||||
# with:
|
||||
# run: yarn test --scenario=SingleRootProject
|
||||
# working-directory: Extension
|
||||
|
||||
# - name: Run E2E IntelliSense features tests (xvfb)
|
||||
# if: ${{ inputs.platform == 'mac' || inputs.platform == 'linux' }}
|
||||
# uses: coactions/setup-xvfb@v1
|
||||
# with:
|
||||
# run: yarn test --scenario=MultirootDeadlockTest
|
||||
# working-directory: Extension
|
||||
@@ -8,17 +8,12 @@ on:
|
||||
description: "readonly: Specify true or 1 to prevent changes from being commited to GitHub"
|
||||
default: false
|
||||
|
||||
env:
|
||||
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
|
||||
|
||||
jobs:
|
||||
main:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
issues: write
|
||||
steps:
|
||||
- name: Checkout Actions
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
uses: actions/checkout@v2
|
||||
- name: Install Actions
|
||||
run: cd ./.github/actions && npm install --production && cd ../..
|
||||
- name: Run Locker
|
||||
@@ -28,4 +23,3 @@ jobs:
|
||||
daysSinceClose: 45
|
||||
daysSinceUpdate: 3
|
||||
ignoreLabels: more votes needed,debugger,internal
|
||||
|
||||
|
||||
@@ -1,24 +1,19 @@
|
||||
name: More Info Needed Closer - debugger
|
||||
on:
|
||||
schedule:
|
||||
- cron: 50 13 * * * # Run at 1:50 PM UTC (5:50 AM PST, 6:50 AM PDT)
|
||||
- cron: 10 11 * * * # Run at 11:10 AM UTC (3:10 AM PST, 4:10 AM PDT)
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
readonly:
|
||||
description: "readonly: Specify true or 1 to prevent changes from being commited to GitHub"
|
||||
default: false
|
||||
|
||||
env:
|
||||
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
|
||||
|
||||
jobs:
|
||||
main:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
issues: write
|
||||
steps:
|
||||
- name: Checkout Actions
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
uses: actions/checkout@v2
|
||||
- name: Install Actions
|
||||
run: cd ./.github/actions && npm install --production && cd ../..
|
||||
- name: Stale Closer
|
||||
@@ -26,10 +21,9 @@ jobs:
|
||||
with:
|
||||
readonly: ${{ github.event.inputs.readonly }}
|
||||
labels: more info needed,debugger
|
||||
ignoreLabels: Language Service,internal
|
||||
ignoreLabels: language service,internal
|
||||
involves: wardengnaw,pieandcakes,calgagi
|
||||
closeDays: 14
|
||||
closeComment: "This issue has been closed because it needs more information and has not had recent activity."
|
||||
pingDays: 7
|
||||
pingComment: "Hey @${assignee}, this issue might need further attention.\n\n@${author}, you can help us out by closing this issue if the problem no longer exists, or adding more information."
|
||||
|
||||
|
||||
@@ -8,17 +8,12 @@ on:
|
||||
description: "readonly: Specify true or 1 to prevent changes from being commited to GitHub"
|
||||
default: false
|
||||
|
||||
env:
|
||||
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
|
||||
|
||||
jobs:
|
||||
main:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
issues: write
|
||||
steps:
|
||||
- name: Checkout Actions
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
uses: actions/checkout@v2
|
||||
- name: Install Actions
|
||||
run: cd ./.github/actions && npm install --production && cd ../..
|
||||
- name: Stale Closer
|
||||
@@ -27,8 +22,7 @@ jobs:
|
||||
readonly: ${{ github.event.inputs.readonly }}
|
||||
labels: more info needed
|
||||
ignoreLabels: debugger,internal
|
||||
closeDays: 30
|
||||
closeDays: 60
|
||||
closeComment: "This issue has been closed because it needs more information and has not had recent activity."
|
||||
pingDays: 14
|
||||
pingDays: 80
|
||||
pingComment: "Hey @${assignee}, this issue might need further attention.\n\n@${author}, you can help us out by closing this issue if the problem no longer exists, or adding more information."
|
||||
|
||||
|
||||
@@ -1,24 +1,19 @@
|
||||
name: Question Closer - debugger
|
||||
on:
|
||||
schedule:
|
||||
- cron: 0 14 * * * # Run at 2:00 PM UTC (6:00 AM PST, 7:00 AM PDT)
|
||||
- cron: 20 11 * * * # Run at 11:20 AM UTC (3:20 AM PST, 4:20 AM PDT)
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
readonly:
|
||||
description: "readonly: Specify true or 1 to prevent changes from being commited to GitHub"
|
||||
default: false
|
||||
|
||||
env:
|
||||
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
|
||||
|
||||
jobs:
|
||||
main:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
issues: write
|
||||
steps:
|
||||
- name: Checkout Actions
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
uses: actions/checkout@v2
|
||||
- name: Install Actions
|
||||
run: cd ./.github/actions && npm install --production && cd ../..
|
||||
- name: Stale Closer
|
||||
@@ -26,10 +21,9 @@ jobs:
|
||||
with:
|
||||
readonly: ${{ github.event.inputs.readonly }}
|
||||
labels: question,debugger
|
||||
ignoreLabels: Language Service,internal
|
||||
ignoreLabels: language service,internal
|
||||
involves: wardengnaw,pieandcakes,calgagi
|
||||
closeDays: 14
|
||||
closeComment: "This issue has been closed because it is a question and has not had recent activity."
|
||||
pingDays: 7
|
||||
pingComment: "Hey @${assignee}, this issue might need further attention.\n\n@${author}, you can help us out by closing this issue if the question has been answered."
|
||||
|
||||
|
||||
@@ -8,17 +8,12 @@ on:
|
||||
description: "readonly: Specify true or 1 to prevent changes from being commited to GitHub"
|
||||
default: false
|
||||
|
||||
env:
|
||||
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
|
||||
|
||||
jobs:
|
||||
main:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
issues: write
|
||||
steps:
|
||||
- name: Checkout Actions
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
uses: actions/checkout@v2
|
||||
- name: Install Actions
|
||||
run: cd ./.github/actions && npm install --production && cd ../..
|
||||
- name: Stale Closer
|
||||
@@ -31,4 +26,3 @@ jobs:
|
||||
closeComment: "This issue has been closed because it is a question and has not had recent activity."
|
||||
pingDays: 80
|
||||
pingComment: "Hey @${assignee}, this issue might need further attention.\n\n@${author}, you can help us out by closing this issue if the question has been answered."
|
||||
|
||||
|
||||
@@ -13,5 +13,3 @@ OneLocBuild
|
||||
|
||||
# ignore imported localization xlf directory
|
||||
vscode-translations-import
|
||||
|
||||
.vscode/settings.json
|
||||
|
||||
-120
@@ -1,120 +0,0 @@
|
||||
name: $(date:yyyyMMdd)$(rev:.r)
|
||||
trigger:
|
||||
branches:
|
||||
include:
|
||||
- main
|
||||
- release
|
||||
- insiders
|
||||
|
||||
schedules:
|
||||
- cron: 30 5 * * 0
|
||||
branches:
|
||||
include:
|
||||
- main
|
||||
always: true
|
||||
|
||||
resources:
|
||||
repositories:
|
||||
- repository: MicroBuildTemplate
|
||||
type: git
|
||||
name: 1ESPipelineTemplates/MicroBuildTemplate
|
||||
ref: refs/tags/release
|
||||
|
||||
variables:
|
||||
- name: Codeql.Enabled
|
||||
value: true
|
||||
- name: Codeql.Language
|
||||
value: javascript
|
||||
|
||||
extends:
|
||||
template: azure-pipelines/MicroBuild.1ES.Official.yml@MicroBuildTemplate
|
||||
parameters:
|
||||
pool:
|
||||
name: AzurePipelines-EO
|
||||
image: 1ESPT-Windows2025
|
||||
os: windows
|
||||
sdl:
|
||||
sourceAnalysisPool:
|
||||
name: AzurePipelines-EO
|
||||
image: 1ESPT-Windows2025
|
||||
os: windows
|
||||
binskim:
|
||||
preReleaseVersion: '4.3.1'
|
||||
tsa:
|
||||
enabled: true
|
||||
config:
|
||||
tsaVersion: TsaV2
|
||||
codebase: NewOrUpdate
|
||||
codebaseName: vscode-cpptools
|
||||
tsaStamp: $(TsaProjectName)
|
||||
tsaEnvironment: PROD
|
||||
notificationAliases: $(TsaNotificationAlias)
|
||||
codebaseAdmins: $(TsaCodebaseAdmins)
|
||||
instanceUrl: $(TsaInstanceUrl)
|
||||
projectName: $(TsaProjectName)
|
||||
areaPath: $(TsaAreaPath)
|
||||
iterationPath: $(TsaIterationPath)
|
||||
alltools: true
|
||||
repositoryName: vscode-cpptools
|
||||
policheck:
|
||||
enabled: true
|
||||
featureFlags:
|
||||
autoBaseline: false
|
||||
settings:
|
||||
networkIsolationPolicy: Permissive,CFSClean,CFSClean2,CFSClean3
|
||||
|
||||
stages:
|
||||
- stage: build
|
||||
jobs:
|
||||
- job: Phase_1
|
||||
displayName: Build cpptools.vsix
|
||||
timeoutInMinutes: 60
|
||||
cancelTimeoutInMinutes: 1
|
||||
templateContext:
|
||||
outputs:
|
||||
- output: pipelineArtifact
|
||||
displayName: 'cpptools.vsix'
|
||||
condition: succeeded()
|
||||
targetPath: $(Build.ArtifactStagingDirectory)\Extension
|
||||
artifactName: cpptools.vsix
|
||||
|
||||
steps:
|
||||
- checkout: self
|
||||
|
||||
- task: UseNode@1
|
||||
displayName: Use Node 22.x
|
||||
inputs:
|
||||
version: 22.x
|
||||
|
||||
- script: IF EXIST %SYSTEMDRIVE%\Users\%USERNAME%\.npmrc del %SYSTEMDRIVE%\Users\%USERNAME%\.npmrc
|
||||
displayName: Delete .npmrc if it exists
|
||||
|
||||
- script: mkdir $(Build.ArtifactStagingDirectory)\Extension
|
||||
displayName: Create Extension Staging Directory
|
||||
|
||||
- task: Bash@3
|
||||
displayName: Build files
|
||||
inputs:
|
||||
targetType: 'inline'
|
||||
script: |
|
||||
export SRC_DIR=$(echo $BUILD_SOURCESDIRECTORY | sed 's|\\|/|g')
|
||||
cd "$SRC_DIR/Extension"
|
||||
npm run vsix-prepublish
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "npm run vsix-prepublish failed, sleeping for 30s before retrying..."
|
||||
sleep 30
|
||||
exit 1
|
||||
fi
|
||||
retryCountOnTaskFailure: 3
|
||||
|
||||
- script: yarn install --frozen-lockfile
|
||||
displayName: Install dependencies with yarn
|
||||
workingDirectory: $(Build.SourcesDirectory)\Extension
|
||||
|
||||
- script: if not exist node_modules\@vscode\vsce-sign\bin\vsce-sign.exe (echo Missing vsce-sign.exe && exit 1)
|
||||
displayName: Verify vsce-sign binary exists
|
||||
workingDirectory: $(Build.SourcesDirectory)\Extension
|
||||
|
||||
- script: npx vsce package --yarn -o $(Build.ArtifactStagingDirectory)\Extension\cpptools.vsix
|
||||
displayName: Run VSCE to package vsix
|
||||
workingDirectory: $(Build.SourcesDirectory)\Extension
|
||||
@@ -2,14 +2,11 @@
|
||||
# Pipeline for VsCodeExtension-Localization build definition
|
||||
# Runs OneLocBuild task to localize xlf file
|
||||
# ==================================================================================
|
||||
|
||||
resources:
|
||||
repositories:
|
||||
- repository: self
|
||||
clean: true
|
||||
- repository: MicroBuildTemplate
|
||||
type: git
|
||||
name: 1ESPipelineTemplates/MicroBuildTemplate
|
||||
ref: refs/tags/release
|
||||
|
||||
trigger: none
|
||||
pr: none
|
||||
@@ -21,72 +18,45 @@ schedules:
|
||||
- main
|
||||
always: true
|
||||
|
||||
variables:
|
||||
TeamName: cpptools
|
||||
Codeql.Language: javascript
|
||||
pool:
|
||||
name: 'AzurePipelines-EO'
|
||||
demands:
|
||||
- ImageOverride -equals AzurePipelinesWindows2022compliant
|
||||
|
||||
extends:
|
||||
template: azure-pipelines/MicroBuild.1ES.Official.yml@MicroBuildTemplate
|
||||
parameters:
|
||||
pool:
|
||||
name: AzurePipelines-EO
|
||||
image: 1ESPT-Windows2025
|
||||
os: windows
|
||||
sdl:
|
||||
sourceAnalysisPool:
|
||||
name: AzurePipelines-EO
|
||||
image: 1ESPT-Windows2025
|
||||
os: windows
|
||||
stages:
|
||||
- stage: stage
|
||||
jobs:
|
||||
- job: job
|
||||
templateContext:
|
||||
outputs:
|
||||
- output: pipelineArtifact
|
||||
targetPath: '$(Build.ArtifactStagingDirectory)'
|
||||
artifactName: 'drop'
|
||||
publishLocation: 'Container'
|
||||
steps:
|
||||
- task: NodeTool@0
|
||||
inputs:
|
||||
versionSpec: '22.x'
|
||||
displayName: 'Install Node.js'
|
||||
steps:
|
||||
- task: NodeTool@0
|
||||
inputs:
|
||||
versionSpec: '16.x'
|
||||
displayName: 'Install Node.js'
|
||||
|
||||
- task: CmdLine@2
|
||||
inputs:
|
||||
script: 'cd Extension && yarn install'
|
||||
- task: CmdLine@2
|
||||
inputs:
|
||||
script: 'cd Extension && yarn install'
|
||||
|
||||
- task: CmdLine@2
|
||||
inputs:
|
||||
script: 'cd ./Extension && yarn run translations-export && cd ..'
|
||||
- task: CmdLine@2
|
||||
inputs:
|
||||
script: 'cd ./Extension && yarn run translations-export && cd ..'
|
||||
|
||||
# Requires Azure client 2.x
|
||||
- task: AzureCLI@2
|
||||
displayName: 'Set OneLocBuildToken'
|
||||
enabled: true
|
||||
inputs:
|
||||
azureSubscription: '$(AzureSubscription)' # Azure DevOps service connection
|
||||
scriptType: 'pscore'
|
||||
scriptLocation: 'inlineScript'
|
||||
inlineScript: |
|
||||
$token = az account get-access-token --query accessToken --resource $(AzureGuid) -o tsv
|
||||
Write-Host "##vso[task.setvariable variable=AzDO.OneLocBuildToken;issecret=true]${token}"
|
||||
- task: OneLocBuild@2
|
||||
env:
|
||||
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
|
||||
inputs:
|
||||
locProj: 'Build/loc/LocProject.json'
|
||||
outDir: '$(Build.ArtifactStagingDirectory)'
|
||||
isCreatePrSelected: false
|
||||
prSourceBranchPrefix: 'locfiles'
|
||||
packageSourceAuth: 'patAuth'
|
||||
patVariable: '$(OneLocBuildPat)'
|
||||
LclSource: lclFilesfromPackage
|
||||
LclPackageId: 'LCL-JUNO-PROD-VCPP'
|
||||
lsBuildXLocPackageVersion: '7.0.30510'
|
||||
|
||||
- task: OneLocBuild@2
|
||||
env:
|
||||
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
|
||||
inputs:
|
||||
locProj: 'Build/loc/LocProject.json'
|
||||
outDir: '$(Build.ArtifactStagingDirectory)'
|
||||
isCreatePrSelected: false
|
||||
prSourceBranchPrefix: 'locfiles'
|
||||
packageSourceAuth: 'patAuth'
|
||||
patVariable: '$(AzDO.OneLocBuildToken)'
|
||||
LclSource: lclFilesfromPackage
|
||||
LclPackageId: 'LCL-JUNO-PROD-VCPP'
|
||||
lsBuildXLocPackageVersion: '7.0.30510'
|
||||
- task: CmdLine@2
|
||||
inputs:
|
||||
script: 'cd Extension && node ./translations_auto_pr.js microsoft vscode-cpptools csigs $(csigsPat) csigs [email protected] "$(Build.ArtifactStagingDirectory)/loc" vscode-extensions-localization-export/vscode-extensions && cd ..'
|
||||
|
||||
- task: CmdLine@2
|
||||
inputs:
|
||||
script: 'cd Extension && node ./translations_auto_pr.js microsoft vscode-cpptools csigs $(csigsPat) csigs [email protected] "$(Build.ArtifactStagingDirectory)/loc" vscode-extensions-localization-export/vscode-extensions && cd ..'
|
||||
- task: PublishBuildArtifacts@1
|
||||
inputs:
|
||||
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
|
||||
ArtifactName: 'drop'
|
||||
publishLocation: 'Container'
|
||||
|
||||
@@ -1,50 +0,0 @@
|
||||
name: $(date:yyyyMMdd)$(rev:.r)
|
||||
trigger: none
|
||||
pr: none
|
||||
|
||||
parameters:
|
||||
- name: verifyVersion
|
||||
displayName: Attest version in package.json is correct
|
||||
type: boolean
|
||||
default: false
|
||||
- name: verifyReadme
|
||||
displayName: Attest README.md is updated
|
||||
type: boolean
|
||||
default: false
|
||||
|
||||
resources:
|
||||
repositories:
|
||||
- repository: MicroBuildTemplate
|
||||
type: git
|
||||
name: 1ESPipelineTemplates/MicroBuildTemplate
|
||||
ref: refs/tags/release
|
||||
|
||||
extends:
|
||||
template: azure-pipelines/MicroBuild.1ES.Official.yml@MicroBuildTemplate
|
||||
parameters:
|
||||
pool:
|
||||
name: AzurePipelines-EO
|
||||
image: 1ESPT-Windows2025
|
||||
os: windows
|
||||
sdl:
|
||||
sourceAnalysisPool:
|
||||
name: AzurePipelines-EO
|
||||
image: 1ESPT-Windows2025
|
||||
os: windows
|
||||
settings:
|
||||
networkIsolationPolicy: Permissive,CFSClean,CFSClean2,CFSClean3
|
||||
|
||||
stages:
|
||||
- stage: package
|
||||
jobs:
|
||||
# Introduce pipeline compilation errors to block scheduling if the requisite parameters are not set
|
||||
- ${{ if not(eq(parameters.verifyVersion, true)) }}:
|
||||
- 'The version in package.json should be updated before scheduling the pipeline.'
|
||||
|
||||
- ${{ if not(eq(parameters.verifyReadme, true)) }}:
|
||||
- 'README.md should be updated before scheduling the pipeline.'
|
||||
|
||||
- template: /Build/package/jobs_package_vsix.yml@self
|
||||
parameters:
|
||||
vsixName: cpptools-extension-pack
|
||||
srcDir: ExtensionPack
|
||||
@@ -1,50 +0,0 @@
|
||||
name: $(date:yyyyMMdd)$(rev:.r)
|
||||
trigger: none
|
||||
pr: none
|
||||
|
||||
parameters:
|
||||
- name: verifyVersion
|
||||
displayName: Attest version in package.json is correct
|
||||
type: boolean
|
||||
default: false
|
||||
- name: verifyReadme
|
||||
displayName: Attest README.md is updated
|
||||
type: boolean
|
||||
default: false
|
||||
|
||||
resources:
|
||||
repositories:
|
||||
- repository: MicroBuildTemplate
|
||||
type: git
|
||||
name: 1ESPipelineTemplates/MicroBuildTemplate
|
||||
ref: refs/tags/release
|
||||
|
||||
extends:
|
||||
template: azure-pipelines/MicroBuild.1ES.Official.yml@MicroBuildTemplate
|
||||
parameters:
|
||||
pool:
|
||||
name: AzurePipelines-EO
|
||||
image: 1ESPT-Windows2025
|
||||
os: windows
|
||||
sdl:
|
||||
sourceAnalysisPool:
|
||||
name: AzurePipelines-EO
|
||||
image: 1ESPT-Windows2025
|
||||
os: windows
|
||||
settings:
|
||||
networkIsolationPolicy: Permissive,CFSClean,CFSClean2,CFSClean3
|
||||
|
||||
stages:
|
||||
- stage: package
|
||||
jobs:
|
||||
# Introduce pipeline compilation errors to block scheduling if the requisite parameters are not set
|
||||
- ${{ if not(eq(parameters.verifyVersion, true)) }}:
|
||||
- 'The version in package.json should be updated before scheduling the pipeline.'
|
||||
|
||||
- ${{ if not(eq(parameters.verifyReadme, true)) }}:
|
||||
- 'README.md should be updated before scheduling the pipeline.'
|
||||
|
||||
- template: /Build/package/jobs_package_vsix.yml@self
|
||||
parameters:
|
||||
vsixName: cpptools-themes
|
||||
srcDir: Themes
|
||||
@@ -1,95 +0,0 @@
|
||||
parameters:
|
||||
- name: vsixName
|
||||
type: string
|
||||
default: ''
|
||||
- name: srcDir
|
||||
type: string
|
||||
default: ''
|
||||
- name: signType
|
||||
type: string
|
||||
default: 'real'
|
||||
|
||||
jobs:
|
||||
- job: package
|
||||
displayName: Build ${{ parameters.vsixName }}.vsix
|
||||
timeoutInMinutes: 30
|
||||
cancelTimeoutInMinutes: 1
|
||||
templateContext:
|
||||
mb: # Enable the MicroBuild Signing toolset
|
||||
signing:
|
||||
enabled: true
|
||||
signType: ${{ parameters.signType }}
|
||||
zipSources: false
|
||||
${{ if eq(parameters.signType, 'real') }}:
|
||||
signWithProd: true
|
||||
featureFlags:
|
||||
autoBaseline: false
|
||||
outputs:
|
||||
- output: pipelineArtifact
|
||||
displayName: '${{ parameters.vsixName }}.vsix'
|
||||
targetPath: $(Build.ArtifactStagingDirectory)\vsix
|
||||
artifactName: vsix
|
||||
|
||||
steps:
|
||||
- checkout: self
|
||||
|
||||
- task: UseNode@1
|
||||
displayName: Use Node 22.x
|
||||
inputs:
|
||||
version: 22.x
|
||||
|
||||
- script: IF EXIST %SYSTEMDRIVE%\Users\%USERNAME%\.npmrc del %SYSTEMDRIVE%\Users\%USERNAME%\.npmrc
|
||||
displayName: Delete .npmrc if it exists
|
||||
|
||||
- task: Bash@3
|
||||
displayName: Build files
|
||||
inputs:
|
||||
targetType: 'inline'
|
||||
script: |
|
||||
export SRC_DIR=$(echo $BUILD_SOURCESDIRECTORY | sed 's|\\|/|g')
|
||||
cd "$SRC_DIR/${{ parameters.srcDir }}"
|
||||
npm install
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "npm install failed, sleeping for 30s before retrying..."
|
||||
sleep 30
|
||||
exit 1
|
||||
fi
|
||||
retryCountOnTaskFailure: 3
|
||||
|
||||
- script: mkdir $(Build.ArtifactStagingDirectory)\vsix
|
||||
displayName: Create Staging Directory
|
||||
|
||||
- script: npm install --no-save --ignore-scripts=false --include=optional --force @vscode/[email protected]
|
||||
displayName: Install vsce
|
||||
workingDirectory: $(Build.SourcesDirectory)\${{ parameters.srcDir }}
|
||||
|
||||
- script: npm rebuild @vscode/vsce-sign --ignore-scripts=false
|
||||
displayName: Rebuild vsce-sign binary
|
||||
workingDirectory: $(Build.SourcesDirectory)\${{ parameters.srcDir }}
|
||||
|
||||
- script: if not exist node_modules\@vscode\vsce-sign\bin\vsce-sign.exe (echo Missing vsce-sign.exe && exit 1)
|
||||
displayName: Verify vsce-sign binary exists
|
||||
workingDirectory: $(Build.SourcesDirectory)\${{ parameters.srcDir }}
|
||||
|
||||
- script: npx vsce package -o $(Build.ArtifactStagingDirectory)\vsix\${{ parameters.vsixName }}.vsix
|
||||
displayName: Run VSCE to package vsix
|
||||
workingDirectory: $(Build.SourcesDirectory)\${{ parameters.srcDir }}
|
||||
|
||||
# sign the vsix
|
||||
- script: npx vsce generate-manifest -i $(Build.ArtifactStagingDirectory)\vsix\${{ parameters.vsixName }}.vsix -o $(Build.ArtifactStagingDirectory)\vsix\${{ parameters.vsixName }}.manifest
|
||||
displayName: generate manifest
|
||||
workingDirectory: $(Build.SourcesDirectory)\${{ parameters.srcDir }}
|
||||
- script: copy $(Build.ArtifactStagingDirectory)\vsix\${{ parameters.vsixName }}.manifest $(Build.ArtifactStagingDirectory)\vsix\${{ parameters.vsixName }}.signature.p7s
|
||||
displayName: prepare manifest for signing
|
||||
workingDirectory: $(Build.SourcesDirectory)\${{ parameters.srcDir }}
|
||||
- task: NuGetToolInstaller@1
|
||||
displayName: Install NuGet
|
||||
- task: NuGetAuthenticate@1
|
||||
displayName: Authenticate NuGet
|
||||
- script: nuget restore $(Build.SourcesDirectory)\Build\signing\SignVsix.proj -PackagesDirectory $(Build.SourcesDirectory)\Build\signing\packages -ConfigFile $(Build.SourcesDirectory)\Build\signing\NuGet.config
|
||||
displayName: Restore MicroBuild Core
|
||||
- task: MSBuild@1
|
||||
displayName: Sign the vsix
|
||||
inputs:
|
||||
solution: $(Build.SourcesDirectory)\Build\signing\SignVsix.proj
|
||||
msbuildArguments: /p:SignType=${{ parameters.signType }}
|
||||
@@ -1,43 +0,0 @@
|
||||
name: $(Date:yyyyMMdd)$(rev:.r)
|
||||
trigger: none
|
||||
pr: none
|
||||
|
||||
resources:
|
||||
repositories:
|
||||
- repository: MicroBuildTemplate
|
||||
type: git
|
||||
name: 1ESPipelineTemplates/MicroBuildTemplate
|
||||
ref: refs/tags/release
|
||||
pipelines:
|
||||
- pipeline: vsixBuild
|
||||
source: '\VC\VSCode\CpptoolsVSIX\Package cpptools-extension-pack'
|
||||
trigger: true
|
||||
|
||||
extends:
|
||||
template: azure-pipelines/MicroBuild.1ES.Official.yml@MicroBuildTemplate
|
||||
parameters:
|
||||
pool:
|
||||
name: AzurePipelines-EO
|
||||
image: 1ESPT-Windows2025
|
||||
os: windows
|
||||
sdl:
|
||||
sourceAnalysisPool:
|
||||
name: AzurePipelines-EO
|
||||
image: 1ESPT-Windows2025
|
||||
os: windows
|
||||
|
||||
stages:
|
||||
- stage: Validate
|
||||
jobs:
|
||||
- template: /Build/publish/jobs_manual_validation.yml@self
|
||||
parameters:
|
||||
notifyUsers: $(NotifyUsers)
|
||||
releaseBuildUrl: $(ReleaseBuildUrl)
|
||||
|
||||
- stage: Release
|
||||
dependsOn: Validate
|
||||
jobs:
|
||||
- template: /Build/publish/jobs_publish_vsix.yml@self
|
||||
parameters:
|
||||
vsixName: cpptools-extension-pack
|
||||
|
||||
@@ -1,43 +0,0 @@
|
||||
name: $(Date:yyyyMMdd)$(rev:.r)
|
||||
trigger: none
|
||||
pr: none
|
||||
|
||||
resources:
|
||||
repositories:
|
||||
- repository: MicroBuildTemplate
|
||||
type: git
|
||||
name: 1ESPipelineTemplates/MicroBuildTemplate
|
||||
ref: refs/tags/release
|
||||
pipelines:
|
||||
- pipeline: vsixBuild
|
||||
source: '\VC\VSCode\CpptoolsVSIX\Package cpptools-themes'
|
||||
trigger: true
|
||||
|
||||
extends:
|
||||
template: azure-pipelines/MicroBuild.1ES.Official.yml@MicroBuildTemplate
|
||||
parameters:
|
||||
pool:
|
||||
name: AzurePipelines-EO
|
||||
image: 1ESPT-Windows2025
|
||||
os: windows
|
||||
sdl:
|
||||
sourceAnalysisPool:
|
||||
name: AzurePipelines-EO
|
||||
image: 1ESPT-Windows2025
|
||||
os: windows
|
||||
|
||||
stages:
|
||||
- stage: Validate
|
||||
jobs:
|
||||
- template: /Build/publish/jobs_manual_validation.yml@self
|
||||
parameters:
|
||||
notifyUsers: $(NotifyUsers)
|
||||
releaseBuildUrl: $(ReleaseBuildUrl)
|
||||
|
||||
- stage: Release
|
||||
dependsOn: Validate
|
||||
jobs:
|
||||
- template: /Build/publish/jobs_publish_vsix.yml@self
|
||||
parameters:
|
||||
vsixName: cpptools-themes
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
parameters:
|
||||
- name: notifyUsers
|
||||
type: string
|
||||
default: ''
|
||||
- name: releaseBuildUrl
|
||||
type: string
|
||||
default: ''
|
||||
|
||||
jobs:
|
||||
- job: WaitForValidation
|
||||
displayName: Wait for VSIX validation
|
||||
pool: server
|
||||
steps:
|
||||
- task: ManualValidation@0
|
||||
displayName: "Manual Validation"
|
||||
inputs:
|
||||
notifyUsers: $(notifyUsers)
|
||||
instructions: |
|
||||
Download and test the vsix from the latest release build: $(releaseBuildUrl)
|
||||
@@ -1,46 +0,0 @@
|
||||
parameters:
|
||||
- name: vsixName
|
||||
type: string
|
||||
default: ''
|
||||
|
||||
jobs:
|
||||
- job: Publish
|
||||
displayName: Publish to Marketplace
|
||||
templateContext:
|
||||
type: releaseJob
|
||||
isProduction: true
|
||||
inputs:
|
||||
- input: pipelineArtifact
|
||||
pipeline: vsixBuild
|
||||
artifactName: vsix
|
||||
targetPath: $(Build.StagingDirectory)\vsix
|
||||
|
||||
steps:
|
||||
- task: NodeTool@0
|
||||
displayName: Use Node 22.x
|
||||
inputs:
|
||||
versionSpec: 22.x
|
||||
|
||||
- task: AzureCLI@2
|
||||
displayName: Generate AAD_TOKEN
|
||||
inputs:
|
||||
azureSubscription: $(AzureSubscription)
|
||||
scriptType: ps
|
||||
scriptLocation: inlineScript
|
||||
inlineScript: |
|
||||
$aadToken = az account get-access-token --query accessToken --resource $(AzureGuid) -o tsv
|
||||
Write-Host "##vso[task.setvariable variable=AAD_TOKEN;issecret=true]$aadToken"
|
||||
|
||||
- script: npm install --no-save --ignore-scripts=false --include=optional --force @vscode/[email protected]
|
||||
displayName: Install vsce
|
||||
|
||||
- script: npm rebuild @vscode/vsce-sign --ignore-scripts=false
|
||||
displayName: Rebuild vsce-sign binary
|
||||
|
||||
- script: if not exist node_modules\@vscode\vsce-sign\bin\vsce-sign.exe (echo Missing vsce-sign.exe && exit 1)
|
||||
displayName: Verify vsce-sign binary exists
|
||||
|
||||
- script: npx vsce publish --skip-duplicate -i $(Build.StagingDirectory)\vsix\${{ parameters.vsixName }}.vsix --manifestPath $(Build.StagingDirectory)\vsix\${{ parameters.vsixName }}.manifest --signaturePath $(Build.StagingDirectory)\vsix\${{ parameters.vsixName }}.signature.p7s
|
||||
displayName: Publish to Marketplace
|
||||
env:
|
||||
VSCE_PAT: $(AAD_TOKEN)
|
||||
@@ -1,7 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<packageSources>
|
||||
<clear />
|
||||
<add key="Engineering" value="https://pkgs.dev.azure.com/devdiv/_packaging/MicroBuildToolset/nuget/v3/index.json" />
|
||||
</packageSources>
|
||||
</configuration>
|
||||
@@ -1,21 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="SignFiles" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="packages\Microsoft.VisualStudioEng.MicroBuild.Core.0.4.1\build\Microsoft.VisualStudioEng.MicroBuild.Core.props" />
|
||||
|
||||
<PropertyGroup>
|
||||
<BaseOutputDirectory>$(BUILD_STAGINGDIRECTORY)/Extension</BaseOutputDirectory>
|
||||
<!-- These properties are required by MicroBuild, which only signs files that are under these paths -->
|
||||
<IntermediateOutputPath>$(BaseOutputDirectory)</IntermediateOutputPath>
|
||||
<OutDir>$(BaseOutputDirectory)</OutDir>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<!-- Because of Webpack bundling, these are the only shipping Javascript files.
|
||||
There are no third-party files to sign because they've all been bundled. -->
|
||||
<FilesToSign Include="$(OutDir)\dist\src\main.js;$(OutDir)\dist\ui\settings.js">
|
||||
<Authenticode>Microsoft400</Authenticode>
|
||||
</FilesToSign>
|
||||
</ItemGroup>
|
||||
|
||||
<Import Project="packages\Microsoft.VisualStudioEng.MicroBuild.Core.0.4.1\build\Microsoft.VisualStudioEng.MicroBuild.Core.targets" />
|
||||
</Project>
|
||||
@@ -1,19 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="SignFiles" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="packages\Microsoft.VisualStudioEng.MicroBuild.Core.0.4.1\build\Microsoft.VisualStudioEng.MicroBuild.Core.props" />
|
||||
|
||||
<PropertyGroup>
|
||||
<BaseOutputDirectory>$(BUILD_STAGINGDIRECTORY)</BaseOutputDirectory>
|
||||
<!-- These properties are required by MicroBuild, which only signs files that are under these paths -->
|
||||
<IntermediateOutputPath>$(BaseOutputDirectory)</IntermediateOutputPath>
|
||||
<OutDir>$(BaseOutputDirectory)</OutDir>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<FilesToSign Include="$(OutDir)\vsix\cpptools-*.signature.p7s">
|
||||
<Authenticode>VSCodePublisher</Authenticode>
|
||||
</FilesToSign>
|
||||
</ItemGroup>
|
||||
|
||||
<Import Project="packages\Microsoft.VisualStudioEng.MicroBuild.Core.0.4.1\build\Microsoft.VisualStudioEng.MicroBuild.Core.targets" />
|
||||
</Project>
|
||||
@@ -1,4 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="Microsoft.VisualStudioEng.MicroBuild.Core" version="0.4.1" developmentDependency="true" />
|
||||
</packages>
|
||||
@@ -1,8 +0,0 @@
|
||||
# Each line is a file pattern followed by one or more owners.
|
||||
|
||||
# These owners will be the default owners for everything in
|
||||
# the repo. Unless a later match takes precedence,
|
||||
# @microsoft/cpptools-maintainers will be requested for
|
||||
# review when someone opens a pull request.
|
||||
|
||||
* @microsoft/cpptools-maintainers
|
||||
+1
-2
@@ -6,5 +6,4 @@ Resources:
|
||||
|
||||
- [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/)
|
||||
- [Microsoft Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/)
|
||||
- Contact [[email protected]](mailto:[email protected]) with questions or concerns
|
||||
- Employees can reach out at [aka.ms/opensource/moderation-support](https://aka.ms/opensource/moderation-support)
|
||||
- Contact [[email protected]](mailto:[email protected]) with questions or concerns
|
||||
+1
-22
@@ -5,7 +5,7 @@
|
||||
* [Build and debug the extension](Documentation/Building%20the%20Extension.md).
|
||||
* File an [issue](https://github.com/Microsoft/vscode-cpptools/issues) and a [pull request](https://github.com/Microsoft/vscode-cpptools/pulls) with the change and we will review it.
|
||||
* If the change affects functionality, add a line describing the change to [**CHANGELOG.md**](Extension/CHANGELOG.md).
|
||||
* Try and add a test in [**test/extension.test.ts**](Extension/test/scenarios/SingleRootProject/tests/extension.test.ts).
|
||||
* Try and add a test in [**test/extension.test.ts**](Extension/test/unitTests/extension.test.ts).
|
||||
* Run tests via opening the [**Extension**](https://github.com/Microsoft/vscode-cpptools/tree/main/Extension) folder in Visual Studio Code, selecting the "Launch Tests" configuration in the Debug pane, and choosing "Start Debugging".
|
||||
|
||||
## About the Code
|
||||
@@ -33,24 +33,3 @@ const localize: nls.LocalizeFunc = nls.loadMessageBundle();
|
||||
const readmeMessage: string = localize("refer.read.me", "Please refer to {0} for troubleshooting information. Issues can be created at {1}", readmePath, "https://github.com/Microsoft/vscode-cpptools/issues");
|
||||
```
|
||||
* The first parameter to localize should be a unique key for that string, not used by any other call to localize() in the file unless representing the same string. The second parameter is the string to localize. Both of these parameters must be string literals. Tokens such as {0} and {1} are supported in the localizable string, with replacement values passed as additional parameters to localize().
|
||||
|
||||
## Contributor License Agreement
|
||||
|
||||
This project welcomes contributions and suggestions. Most contributions require you to
|
||||
agree to a Contributor License Agreement (CLA) declaring that you have the right to,
|
||||
and actually do, grant us the rights to use your contribution. For details, visit
|
||||
https://cla.microsoft.com.
|
||||
|
||||
When you submit a pull request, a CLA-bot will automatically determine whether you need
|
||||
to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the
|
||||
instructions provided by the bot. You will only need to do this once across all repositories using our CLA.
|
||||
|
||||
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
|
||||
For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/)
|
||||
or contact [[email protected]](mailto:[email protected]) with any additional questions or comments.
|
||||
|
||||
### Adding/Updating package.json dependencies
|
||||
|
||||
We maintain a public Azure Artifacts feed that we point the package manager to in .npmrc files. If you want to add a dependency or update a version in package.json, you may need to contact us so we can add it to our feed. Please ping our team in a PR or new issue if you experience this issue.
|
||||
|
||||
For local development, you can delete the .npmrc file and the matching `yarn.lock` file while you wait for us to update the feed. However, these changes will need to be reverted in your branch before we will accept a PR.
|
||||
@@ -5,7 +5,7 @@ These steps will allow you to debug the TypeScript code that is part of the Micr
|
||||
Prerequisite steps:
|
||||
* Clone the release branch of [this](https://github.com/Microsoft/vscode-cpptools) repository.
|
||||
* git clone -b release https://github.com/Microsoft/vscode-cpptools
|
||||
* Install the [required Node.js version](../Extension/readme.developer.md#required-tools).
|
||||
* Install [node](https://nodejs.org).
|
||||
* Install [yarn](https://yarnpkg.com).
|
||||
* From a command line, run the following commands from the **Extension** folder in the root of the repository:
|
||||
* `yarn install` will install the dependencies needed to build the extension.
|
||||
|
||||
@@ -1 +1 @@
|
||||
The documentation for c_cpp_properties.json has moved to https://code.visualstudio.com/docs/cpp/customize-cpp-settings.
|
||||
The documentation for c_cpp_properties.json has moved to https://code.visualstudio.com/docs/cpp/c-cpp-properties-schema-reference.
|
||||
@@ -0,0 +1,4 @@
|
||||
*.js
|
||||
|
||||
dist/
|
||||
vscode*.d.ts
|
||||
@@ -0,0 +1,166 @@
|
||||
module.exports = {
|
||||
"extends": [
|
||||
"eslint:recommended",
|
||||
"plugin:@typescript-eslint/eslint-recommended",
|
||||
"plugin:@typescript-eslint/strict",
|
||||
],
|
||||
"env": {
|
||||
"browser": true,
|
||||
"es6": true,
|
||||
"node": true
|
||||
},
|
||||
"parser": "@typescript-eslint/parser",
|
||||
"parserOptions": {
|
||||
"project": ["tsconfig.json", ".scripts/tsconfig.json"],
|
||||
"ecmaVersion": 2022,
|
||||
"sourceType": "module",
|
||||
"warnOnUnsupportedTypeScriptVersion": false,
|
||||
},
|
||||
"plugins": [
|
||||
"@typescript-eslint",
|
||||
"eslint-plugin-jsdoc",
|
||||
"@typescript-eslint/eslint-plugin",
|
||||
"eslint-plugin-import",
|
||||
"eslint-plugin-header"
|
||||
],
|
||||
"rules": {
|
||||
"indent": [
|
||||
"warn",
|
||||
4,
|
||||
{
|
||||
"SwitchCase": 1,
|
||||
"ObjectExpression": "first"
|
||||
}
|
||||
],
|
||||
"@typescript-eslint/indent": [
|
||||
"error", 4
|
||||
],
|
||||
"@typescript-eslint/adjacent-overload-signatures": "error",
|
||||
"@typescript-eslint/array-type": "error",
|
||||
"@typescript-eslint/await-thenable": "error",
|
||||
"camelcase": "off",
|
||||
"@typescript-eslint/naming-convention": [
|
||||
"error",
|
||||
{
|
||||
"selector": "typeLike",
|
||||
"format": ["PascalCase"]
|
||||
}
|
||||
],
|
||||
"@typescript-eslint/member-delimiter-style": [
|
||||
"error",
|
||||
{
|
||||
"multiline": {
|
||||
"delimiter": "semi",
|
||||
"requireLast": true
|
||||
},
|
||||
"singleline": {
|
||||
"delimiter": "semi",
|
||||
"requireLast": false
|
||||
}
|
||||
}
|
||||
],
|
||||
"@typescript-eslint/no-explicit-any": "off",
|
||||
"@typescript-eslint/no-extraneous-class": "off",
|
||||
"no-case-declarations": "off",
|
||||
"no-useless-escape": "off",
|
||||
"no-floating-decimal": "error",
|
||||
"keyword-spacing": ["error", { "before": true, "overrides": { "this": { "before": false } } }],
|
||||
"arrow-spacing": ["error", { "before": true, "after": true }],
|
||||
"semi-spacing": ["error", { "before": false, "after": true }],
|
||||
"no-extra-parens": ["error", "all", { "nestedBinaryExpressions": false, "ternaryOperandBinaryExpressions": false }],
|
||||
"@typescript-eslint/no-array-constructor": "error",
|
||||
"@typescript-eslint/no-useless-constructor": "error",
|
||||
"@typescript-eslint/no-for-in-array": "error",
|
||||
"@typescript-eslint/no-misused-new": "error",
|
||||
"@typescript-eslint/no-misused-promises": "error",
|
||||
"@typescript-eslint/no-namespace": "error",
|
||||
"@typescript-eslint/no-non-null-assertion": "error",
|
||||
"@typescript-eslint/no-extra-non-null-assertion": "error",
|
||||
"@typescript-eslint/no-this-alias": "error",
|
||||
"@typescript-eslint/no-unnecessary-qualifier": "error",
|
||||
"@typescript-eslint/no-unnecessary-type-arguments": "error",
|
||||
"@typescript-eslint/no-var-requires": "error",
|
||||
"@typescript-eslint/prefer-function-type": "error",
|
||||
"@typescript-eslint/prefer-namespace-keyword": "error",
|
||||
"@typescript-eslint/semi": "error",
|
||||
"@typescript-eslint/triple-slash-reference": "error",
|
||||
"@typescript-eslint/type-annotation-spacing": "error",
|
||||
"@typescript-eslint/unified-signatures": "error",
|
||||
"@typescript-eslint/no-floating-promises": "error",
|
||||
"@typescript-eslint/method-signature-style": ["error", "method"],
|
||||
"@typescript-eslint/space-infix-ops": "error",
|
||||
"no-unused-vars": "off",
|
||||
"@typescript-eslint/no-unused-vars": ["error", { "argsIgnorePattern": "^_" }],
|
||||
"@typescript-eslint/no-unnecessary-boolean-literal-compare": "error",
|
||||
"arrow-body-style": "error",
|
||||
"comma-dangle": "error",
|
||||
"comma-spacing": "off",
|
||||
"@typescript-eslint/comma-spacing": "error",
|
||||
"constructor-super": "error",
|
||||
"curly": "error",
|
||||
"eol-last": "error",
|
||||
"eqeqeq": [
|
||||
"error",
|
||||
"always"
|
||||
],
|
||||
"import/no-default-export": "error",
|
||||
"import/no-unassigned-import": "error",
|
||||
"jsdoc/no-types": "error",
|
||||
"new-parens": "error",
|
||||
"no-bitwise": "error",
|
||||
"no-caller": "error",
|
||||
"no-cond-assign": "error",
|
||||
"no-debugger": "error",
|
||||
"no-duplicate-case": "error",
|
||||
"no-duplicate-imports": "error",
|
||||
"no-eval": "error",
|
||||
"no-fallthrough": "error",
|
||||
"no-invalid-this": "error",
|
||||
"no-irregular-whitespace": "error",
|
||||
"rest-spread-spacing": ["error", "never"],
|
||||
"no-multiple-empty-lines": ["error", { "max": 1, "maxEOF": 1, "maxBOF": 0 }],
|
||||
"no-new-wrappers": "error",
|
||||
"no-return-await": "error",
|
||||
"no-sequences": "error",
|
||||
"no-sparse-arrays": "error",
|
||||
"no-trailing-spaces": "error",
|
||||
"no-multi-spaces": "error",
|
||||
"no-undef-init": "error",
|
||||
"no-unsafe-finally": "error",
|
||||
"no-unused-expressions": "error",
|
||||
"no-unused-labels": "error",
|
||||
"space-before-blocks": "error",
|
||||
"no-var": "error",
|
||||
"one-var": [
|
||||
"error",
|
||||
"never"
|
||||
],
|
||||
"prefer-const": "error",
|
||||
"prefer-object-spread": "error",
|
||||
"space-in-parens": [
|
||||
"error",
|
||||
"never"
|
||||
],
|
||||
"spaced-comment": [
|
||||
"off",
|
||||
"always",
|
||||
{ "line": { "exceptions": ["/"] } } // triple slash directives
|
||||
],
|
||||
"use-isnan": "error",
|
||||
"valid-typeof": "error",
|
||||
"yoda": "error",
|
||||
"space-infix-ops": "error",
|
||||
"header/header": [
|
||||
"warn",
|
||||
"block",
|
||||
[
|
||||
" --------------------------------------------------------------------------------------------",
|
||||
" * Copyright (c) Microsoft Corporation. All Rights Reserved.",
|
||||
" * See 'LICENSE' in the project root for license information.",
|
||||
" * ------------------------------------------------------------------------------------------ "
|
||||
|
||||
],
|
||||
],
|
||||
|
||||
}
|
||||
};
|
||||
@@ -9,18 +9,10 @@ dist
|
||||
server
|
||||
debugAdapters
|
||||
LLVM
|
||||
bin/assert_dialog.sh
|
||||
bin/binaryVersion.json
|
||||
bin/cpptools*
|
||||
bin/edge_cli
|
||||
bin/isense_driver
|
||||
bin/libc.so
|
||||
bin/LICENSE.txt
|
||||
bin/scout_driver
|
||||
bin/unittests
|
||||
bin/vcpkgsrvtest
|
||||
bin/*.dll
|
||||
bin/.vs
|
||||
bin/LICENSE.txt
|
||||
|
||||
# ignore lock files
|
||||
install.lock
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
registry=https://pkgs.dev.azure.com/azure-public/VisualCpp/_packaging/cpp_PublicPackages/npm/registry/
|
||||
# Disable postinstall scripts for supply chain security. Allowlist exceptions with npm trust: https://docs.npmjs.com/cli/v11/commands/npm-trust
|
||||
ignore-scripts=true
|
||||
|
||||
min-release-age=7
|
||||
audit=true
|
||||
audit-level=high
|
||||
@@ -18,20 +18,18 @@ export async function main() {
|
||||
}
|
||||
|
||||
export async function all() {
|
||||
await rimraf(...(await getModifiedIgnoredFiles()).filter((each): each is string => each !== undefined && !each.includes('node_modules')));
|
||||
await rimraf(...(await getModifiedIgnoredFiles()).filter(each => !each.includes('node_modules')));
|
||||
}
|
||||
|
||||
export async function reset() {
|
||||
verbose(`Resetting all .gitignored files in extension`);
|
||||
await rimraf(...(await getModifiedIgnoredFiles()).filter((each): each is string => each !== undefined));
|
||||
await rimraf(...await getModifiedIgnoredFiles());
|
||||
}
|
||||
|
||||
async function details(files: string[]) {
|
||||
const results = await Promise.all(files.filter(each => each).map(async (each) => {
|
||||
const [, stats] = await filepath.stats(each);
|
||||
if (!stats) {
|
||||
return null;
|
||||
}
|
||||
let all = await Promise.all(files.filter(each => each).map(async (each) => {
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
const [filename, stats ] = await filepath.stats(each);
|
||||
return {
|
||||
filename: stats.isDirectory() ? cyan(`${each}${sep}**`) : brightGreen(`${each}`),
|
||||
date: stats.mtime.toLocaleDateString().replace(/\b(\d)\//g, '0$1\/'),
|
||||
@@ -39,7 +37,6 @@ async function details(files: string[]) {
|
||||
modified: stats.mtime
|
||||
};
|
||||
}));
|
||||
let all = results.filter((each): each is NonNullable<typeof each> => each !== null);
|
||||
all = all.sort((a, b) => a.modified.getTime() - b.modified.getTime());
|
||||
// print a formatted table so the date and time are aligned
|
||||
const max = all.reduce((max, each) => Math.max(max, each.filename.length), 0);
|
||||
@@ -59,7 +56,7 @@ export async function show(opt?: string) {
|
||||
case 'ignored':
|
||||
case 'untracked':
|
||||
console.log(cyan('\n\nUntracked+Ignored files:'));
|
||||
return details((await getModifiedIgnoredFiles()).filter((each): each is string => each !== undefined));
|
||||
return details(await getModifiedIgnoredFiles());
|
||||
|
||||
default:
|
||||
return error(`Unknown option '${opt}'`);
|
||||
|
||||
@@ -33,10 +33,8 @@ export async function main() {
|
||||
//verbose(`Installing release version of 'ms-vscode.cpptools'`);
|
||||
//spawnSync(cli, [...args, '--install-extension', 'ms-vscode.cpptools'], { encoding: 'utf-8', stdio: 'ignore' })
|
||||
verbose(green('Launch VSCode'));
|
||||
const ARGS = [...args, ...options.launchArgs.filter(each => !each.startsWith('--extensions-dir=') && !each.startsWith('--user-data-dir=')), `--extensionDevelopmentPath=${$root}`, ...$args ].map(each => (each.indexOf(' ') > -1) && (each.indexOf('"') === -1) ? `"${each}"` : each);
|
||||
const CLI = cli.indexOf(' ') > -1 && cli.indexOf('"') === -1 ? `"${cli}"` : cli;
|
||||
const ARGS = [...args, ...options.launchArgs.filter(each => !each.startsWith('--extensions-dir=') && !each.startsWith('--user-data-dir=')), `--extensionDevelopmentPath=${$root}`, ...$args ];
|
||||
verbose(gray(`${cli}\n ${ [...ARGS ].join('\n ')}`));
|
||||
|
||||
verbose(gray(`${CLI}\n ${ [...ARGS ].join('\n ')}`));
|
||||
|
||||
spawnSync(CLI, ARGS, { encoding: 'utf-8', stdio: 'ignore', env: { ...process.env, DONT_PROMPT_WSL_INSTALL:"1" }, shell: true });
|
||||
spawnSync(cli, ARGS, { encoding: 'utf-8', stdio: 'ignore', env: { ...process.env, DONT_PROMPT_WSL_INSTALL:"1" } });
|
||||
}
|
||||
|
||||
@@ -20,18 +20,9 @@ import { verbose } from '../src/Utility/Text/streams';
|
||||
export const $root = resolve(`${__dirname}/..`);
|
||||
export let $cmd = 'main';
|
||||
export let $scenario = '';
|
||||
export const $scenarioArgs: string[] = [];
|
||||
|
||||
// loop through the args and pick out --scenario=... and remove it from the $args and set $scenario
|
||||
process.argv.slice(2).filter(each => !(each.startsWith('--scenario=') && ($scenario = each.substring('--scenario='.length))));
|
||||
// parse out the scenario arguments.
|
||||
process.argv.slice(2).reduce<string[]>((acc, arg) => {
|
||||
if (arg.startsWith('--scenario-arg=')) {
|
||||
acc.push(arg.substring('--scenario-arg='.length));
|
||||
}
|
||||
return acc;
|
||||
}, $scenarioArgs);
|
||||
|
||||
export const $args = process.argv.slice(2).filter(each => !each.startsWith('--'));
|
||||
export const $switches = process.argv.slice(2).filter(each => each.startsWith('--'));
|
||||
|
||||
@@ -48,7 +39,7 @@ chdir($root);
|
||||
|
||||
// dump unhandled async errors to the console and exit.
|
||||
process.on('unhandledRejection', (reason: any, _promise) => {
|
||||
error(`${reason?.stack?.split(/\r?\n/).filter((l: string) => !l.includes('node:internal') && !l.includes('node_modules')).join('\n')}`);
|
||||
error(`${reason?.stack?.split(/\r?\n/).filter(l => !l.includes('node:internal') && !l.includes('node_modules')).join('\n')}`);
|
||||
process.exit(1);
|
||||
});
|
||||
|
||||
@@ -57,29 +48,28 @@ export const Git = async (...args: Parameters<Awaited<CommandFunction>>) => (awa
|
||||
export const GitClean = async (...args: Parameters<Awaited<CommandFunction>>) => (await new Command(await git, 'clean'))(...args);
|
||||
|
||||
export async function getModifiedIgnoredFiles() {
|
||||
const { code, error, stdio } = await GitClean('-Xd', '-n');
|
||||
const {code, error, stdio } = await GitClean('-Xd', '-n');
|
||||
if (code) {
|
||||
throw new Error(`\n${error.all().join('\n')}`);
|
||||
}
|
||||
|
||||
// return the full path of files that would be removed.
|
||||
// eslint-disable-next-line @typescript-eslint/no-misused-promises
|
||||
return Promise.all(stdio.filter("Would remove").map((s) => filepath.exists(s.replace(/^Would remove /, ''), $root)).filter(p => p));
|
||||
}
|
||||
|
||||
export async function rimraf(...paths: string[]) {
|
||||
const all: Promise<void>[] = [];
|
||||
const all = [];
|
||||
for (const each of paths) {
|
||||
if (!each) {
|
||||
continue;
|
||||
}
|
||||
if (await filepath.isFolder(each)) {
|
||||
verbose(`Removing folder ${red(each)}`);
|
||||
all.push(rm(each, { recursive: true, force: true }));
|
||||
all.push(rm(each, {recursive: true, force: true}));
|
||||
continue;
|
||||
}
|
||||
verbose(`Removing file ${red(each)}`);
|
||||
all.push(rm(each, { force: true }));
|
||||
all.push(rm(each, {force: true}));
|
||||
}
|
||||
await Promise.all(all);
|
||||
}
|
||||
@@ -92,9 +82,6 @@ export async function mkdir(filePath: string) {
|
||||
}
|
||||
throw new Error(`Cannot create directory '${filePath}' because there is a file there.`);
|
||||
}
|
||||
if (!fullPath) {
|
||||
throw new Error(`Cannot create directory '${filePath}' because the path is invalid.`);
|
||||
}
|
||||
|
||||
await md(fullPath, { recursive: true });
|
||||
return fullPath;
|
||||
@@ -271,7 +258,7 @@ export function position(text: string) {
|
||||
return gray(`${text}`);
|
||||
}
|
||||
|
||||
export async function assertAnyFolder(oneOrMoreFolders: string | string[], errorMessage?: string): Promise<string | undefined> {
|
||||
export async function assertAnyFolder(oneOrMoreFolders: string | string[], errorMessage?: string): Promise<string> {
|
||||
oneOrMoreFolders = is.array(oneOrMoreFolders) ? oneOrMoreFolders : [oneOrMoreFolders];
|
||||
for (const each of oneOrMoreFolders) {
|
||||
const result = await filepath.isFolder(each, $root);
|
||||
@@ -288,7 +275,7 @@ export async function assertAnyFolder(oneOrMoreFolders: string | string[], error
|
||||
}
|
||||
}
|
||||
|
||||
export async function assertAnyFile(oneOrMoreFiles: string | string[], errorMessage?: string): Promise<string | undefined> {
|
||||
export async function assertAnyFile(oneOrMoreFiles: string | string[], errorMessage?: string): Promise<string> {
|
||||
oneOrMoreFiles = is.array(oneOrMoreFiles) ? oneOrMoreFiles : [oneOrMoreFiles];
|
||||
for (const each of oneOrMoreFiles) {
|
||||
const result = await filepath.isFile(each, $root);
|
||||
@@ -346,9 +333,6 @@ export async function checkDTS() {
|
||||
}
|
||||
|
||||
export async function checkBinaries() {
|
||||
if ($switches.includes('--skipCheckBinaries')) {
|
||||
return false;
|
||||
}
|
||||
let failing = false;
|
||||
failing = !await assertAnyFile(['bin/cpptools.exe', 'bin/cpptools']) && (quiet || warn(`The native binary files are not present. You should either build or install the native binaries\n\n.`)) || failing;
|
||||
|
||||
@@ -357,15 +341,3 @@ export async function checkBinaries() {
|
||||
}
|
||||
return failing;
|
||||
}
|
||||
|
||||
export async function checkProposals() {
|
||||
let failing = false;
|
||||
|
||||
await rm(`${$root}/vscode.proposed.chatParticipantAdditions.d.ts`);
|
||||
failing = await assertAnyFile('vscode.proposed.chatParticipantAdditions.d.ts') && (quiet || warn(`The VSCode import file '${$root}/vscode.proposed.chatParticipantAdditions.d.ts' should not be present.`)) || failing;
|
||||
|
||||
if (!failing) {
|
||||
verbose('VSCode proposals appear to be in place.');
|
||||
}
|
||||
return failing;
|
||||
}
|
||||
|
||||
@@ -1,176 +0,0 @@
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All Rights Reserved.
|
||||
* See 'LICENSE' in the project root for license information.
|
||||
* ------------------------------------------------------------------------------------------ */
|
||||
|
||||
import { cp, readdir, rm, stat } from 'node:fs/promises';
|
||||
import { homedir } from 'node:os';
|
||||
import { basename, join } from 'node:path';
|
||||
import { verbose } from '../src/Utility/Text/streams';
|
||||
import { $args, $root, Git, green, heading, note, warn } from './common';
|
||||
|
||||
const extensionPrefix = 'ms-vscode.cpptools-';
|
||||
const foldersToCopy = ['bin', 'debugAdapters', 'LLVM'] as const;
|
||||
|
||||
type InstalledExtension = {
|
||||
path: string;
|
||||
version: number[];
|
||||
modified: number;
|
||||
};
|
||||
|
||||
function compareVersions(left: number[], right: number[]): number {
|
||||
const maxLength: number = Math.max(left.length, right.length);
|
||||
for (let i = 0; i < maxLength; i++) {
|
||||
const diff: number = (left[i] ?? 0) - (right[i] ?? 0);
|
||||
if (diff !== 0) {
|
||||
return diff;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
function tryParseVersion(folderName: string): number[] | undefined {
|
||||
if (!folderName.startsWith(extensionPrefix)) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
const versionText: string | undefined = folderName.substring(extensionPrefix.length).match(/^\d+\.\d+\.\d+/)?.[0];
|
||||
return versionText?.split('.').map(each => Number(each));
|
||||
}
|
||||
|
||||
async function getInstalledExtensions(root: string): Promise<InstalledExtension[]> {
|
||||
try {
|
||||
const entries = await readdir(root, { withFileTypes: true });
|
||||
const candidates: Promise<InstalledExtension | undefined>[] = entries.map(async (entry) => {
|
||||
if (!entry.isDirectory()) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
const version: number[] | undefined = tryParseVersion(entry.name);
|
||||
if (!version) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
const extensionPath: string = join(root, entry.name);
|
||||
for (const folder of foldersToCopy) {
|
||||
const info = await stat(join(extensionPath, folder)).catch(() => undefined);
|
||||
if (!info?.isDirectory()) {
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
|
||||
const info = await stat(extensionPath);
|
||||
return {
|
||||
path: extensionPath,
|
||||
version,
|
||||
modified: info.mtimeMs
|
||||
};
|
||||
});
|
||||
|
||||
const found = await Promise.all(candidates);
|
||||
return found.filter((entry): entry is InstalledExtension => entry !== undefined);
|
||||
} catch {
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
||||
async function findExtensionsFolder(root: string): Promise<string | undefined> {
|
||||
try {
|
||||
const entries = await readdir(root, { withFileTypes: true });
|
||||
for (const entry of entries) {
|
||||
if (entry.isDirectory()) {
|
||||
if (entry.name === 'extensions') {
|
||||
const extensionEntries = await readdir(join(root, entry.name), { withFileTypes: true });
|
||||
for (const extensionEntry of extensionEntries) {
|
||||
if (extensionEntry.isDirectory() && extensionEntry.name.startsWith(extensionPrefix)) {
|
||||
return join(root, entry.name);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
const result = await findExtensionsFolder(join(root, entry.name));
|
||||
if (result) {
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch {
|
||||
// Ignore errors (permission denied, etc.)
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
|
||||
async function findLatestInstalledExtension(providedPath?: string): Promise<string> {
|
||||
const searchRoots: string[] = [
|
||||
join(homedir(), '.vscode', 'extensions'),
|
||||
join(homedir(), '.vscode-insiders', 'extensions'),
|
||||
join(homedir(), '.vscode-server', 'extensions'),
|
||||
join(homedir(), '.vscode-server-insiders', 'extensions')
|
||||
];
|
||||
if (providedPath) {
|
||||
// find a folder called 'extensions' recursively under the provided path and add it to the front of the search roots
|
||||
const extensionsFolderPath = await findExtensionsFolder(providedPath);
|
||||
if (extensionsFolderPath) {
|
||||
verbose(`Found extensions folder under provided path: ${extensionsFolderPath}`);
|
||||
searchRoots.unshift(extensionsFolderPath);
|
||||
}
|
||||
}
|
||||
|
||||
const installed: InstalledExtension[] = (await Promise.all(searchRoots.map(each => getInstalledExtensions(each)))).flat();
|
||||
if (!installed.length) {
|
||||
throw new Error(`Unable to find an installed C/C++ extension under ${searchRoots.join(' or ')}.`);
|
||||
}
|
||||
|
||||
installed.sort((left, right) => compareVersions(right.version, left.version) || right.modified - left.modified);
|
||||
return installed[0].path;
|
||||
}
|
||||
|
||||
/**
|
||||
* A few files inside the copied folders are checked into the repo (for example bin/cpp.hint and
|
||||
* bin/messages/**). The copy overwrites them with the installed extension's versions, which can differ
|
||||
* in line endings or content and then show up as spurious local modifications. Restore any tracked files
|
||||
* that the copy changed so only the untracked binaries remain in the working tree.
|
||||
*/
|
||||
async function restoreTrackedFiles(): Promise<void> {
|
||||
const modified = await Git('ls-files', '--modified', '--', ...foldersToCopy);
|
||||
if (modified.code) {
|
||||
warn(`Unable to determine which tracked files to restore: ${modified.error.all().join('\n')}`);
|
||||
return;
|
||||
}
|
||||
|
||||
const files = modified.stdio.all().map(line => line.trim()).filter(line => line.length > 0);
|
||||
if (!files.length) {
|
||||
return;
|
||||
}
|
||||
|
||||
const restored = await Git('checkout', '--', ...files);
|
||||
if (restored.code) {
|
||||
warn(`Unable to restore tracked files after copy: ${restored.error.all().join('\n')}`);
|
||||
return;
|
||||
}
|
||||
|
||||
note(`Restored ${files.length} tracked ${files.length === 1 ? 'file' : 'files'} overwritten by the copy.`);
|
||||
}
|
||||
|
||||
export async function main(sourcePath = $args[0]): Promise<string | undefined> {
|
||||
console.log(heading('Copy installed extension binaries'));
|
||||
|
||||
const installedExtensionPath: string = await findLatestInstalledExtension(sourcePath);
|
||||
note(`Using installed extension at ${installedExtensionPath}`);
|
||||
|
||||
for (const folder of foldersToCopy) {
|
||||
const source: string = join(installedExtensionPath, folder);
|
||||
const destination: string = join($root, folder);
|
||||
|
||||
console.log(`Copying ${green(folder)} from ${source}`);
|
||||
await rm(destination, { recursive: true, force: true });
|
||||
await cp(source, destination, { recursive: true, force: true });
|
||||
}
|
||||
|
||||
note(`Copied installed binaries into ${$root}`);
|
||||
|
||||
await restoreTrackedFiles();
|
||||
|
||||
const installedVersion = tryParseVersion(basename(installedExtensionPath));
|
||||
return installedVersion?.join('.');
|
||||
}
|
||||
@@ -19,7 +19,7 @@ export async function watch() {
|
||||
verbose(`Watching ${source} folder for changes.`);
|
||||
console.log('Press Ctrl+C to exit.');
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
for await (const event of watchFiles(source, { recursive: true })) {
|
||||
for await (const event of watchFiles(source, {recursive: true })) {
|
||||
await main();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
* See 'LICENSE' in the project root for license information.
|
||||
* ------------------------------------------------------------------------------------------ */
|
||||
|
||||
/* eslint-disable no-prototype-builtins */
|
||||
|
||||
import { resolve } from 'path';
|
||||
import { $root, read, write } from './common';
|
||||
|
||||
@@ -85,13 +87,8 @@ function replaceReferences(definitions: any, objects: any): any {
|
||||
objects[key].anyOf = replaceReferences(definitions, objects[key].anyOf);
|
||||
}
|
||||
|
||||
// Handle 'oneOf' with references
|
||||
if (objects[key].hasOwnProperty('oneOf')) {
|
||||
objects[key].oneOf = replaceReferences(definitions, objects[key].oneOf);
|
||||
}
|
||||
|
||||
// Recursively replace references if this schema node has properties.
|
||||
if (objects[key].hasOwnProperty('properties') && objects[key].properties !== null) {
|
||||
// Recursively replace references if this object has properties.
|
||||
if (objects[key].hasOwnProperty('type') && objects[key].type === 'object' && objects[key].properties !== null) {
|
||||
objects[key].properties = replaceReferences(definitions, objects[key].properties);
|
||||
objects[key].properties = updateDefaults(objects[key].properties, objects[key].default);
|
||||
}
|
||||
@@ -122,13 +119,11 @@ function mergeReferences(baseDefinitions: any, additionalDefinitions: any): void
|
||||
export async function main() {
|
||||
const packageJSON: any = JSON.parse(await read(resolve($root, 'package.json')));
|
||||
const schemaJSON: any = JSON.parse(await read(resolve($root, 'tools/OptionsSchema.json')));
|
||||
const taskDefinitionsJSON: any = JSON.parse(await read(resolve($root, 'tools/TaskDefinitionsSchema.json')));
|
||||
const symbolSettingsJSON: any = JSON.parse(await read(resolve($root, 'tools/VSSymbolSettings.json')));
|
||||
|
||||
mergeReferences(schemaJSON.definitions, symbolSettingsJSON.definitions);
|
||||
|
||||
schemaJSON.definitions = replaceReferences(schemaJSON.definitions, schemaJSON.definitions);
|
||||
taskDefinitionsJSON.definitions = replaceReferences(taskDefinitionsJSON.definitions, taskDefinitionsJSON.definitions);
|
||||
|
||||
// Hard Code adding in configurationAttributes launch and attach.
|
||||
// cppdbg
|
||||
@@ -139,9 +134,6 @@ export async function main() {
|
||||
packageJSON.contributes.debuggers[1].configurationAttributes.launch = schemaJSON.definitions.CppvsdbgLaunchOptions;
|
||||
packageJSON.contributes.debuggers[1].configurationAttributes.attach = schemaJSON.definitions.CppvsdbgAttachOptions;
|
||||
|
||||
// task definitions
|
||||
packageJSON.contributes.taskDefinitions = [taskDefinitionsJSON.definitions.CppBuildTaskDefinition];
|
||||
|
||||
let content: string = JSON.stringify(packageJSON, null, 4);
|
||||
|
||||
// We use '\u200b' (unicode zero-length space character) to break VS Code's URL detection regex for URLs that are examples. This process will
|
||||
|
||||
@@ -1,37 +0,0 @@
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All Rights Reserved.
|
||||
* See 'LICENSE' in the project root for license information.
|
||||
* ------------------------------------------------------------------------------------------ */
|
||||
|
||||
import { runVSCodeCommand } from '@vscode/test-electron';
|
||||
import { writeFile } from 'node:fs/promises';
|
||||
import { join } from 'node:path';
|
||||
import { $root, error, heading, note, warn } from './common';
|
||||
import * as copy from './copyExtensionBinaries';
|
||||
import { install, isolated, options } from "./vscode";
|
||||
|
||||
export async function main() {
|
||||
console.log(heading(`Install VS Code`));
|
||||
const vscode = await install();
|
||||
if (!vscode) {
|
||||
error('Failed to install VS Code');
|
||||
return;
|
||||
}
|
||||
|
||||
console.log(heading('Install latest C/C++ Extension'));
|
||||
const result = await runVSCodeCommand([...vscode.args ?? [], '--install-extension', 'ms-vscode.cpptools', '--pre-release'], options);
|
||||
if (result.stdout) {
|
||||
console.log(result.stdout.toString());
|
||||
}
|
||||
if (result.stderr) {
|
||||
// runVSCodeCommand resolves only when the command succeeds (it throws on a non-zero exit), so stderr here is
|
||||
// non-fatal output such as Node deprecation warnings and must not be reported as an error.
|
||||
warn(result.stderr.toString());
|
||||
}
|
||||
|
||||
const binaryVersion = await copy.main(isolated);
|
||||
if (binaryVersion) {
|
||||
await writeFile(join($root, 'bin', 'binaryVersion.json'), JSON.stringify({ version: binaryVersion }));
|
||||
note(`Wrote binary version ${binaryVersion} to bin/binaryVersion.json`);
|
||||
}
|
||||
}
|
||||
@@ -14,7 +14,7 @@ import { filepath } from '../src/Utility/Filesystem/filepath';
|
||||
import { is } from '../src/Utility/System/guards';
|
||||
import { verbose } from '../src/Utility/Text/streams';
|
||||
import { getTestInfo } from '../test/common/selectTests';
|
||||
import { $args, $root, $scenario, $scenarioArgs, assertAnyFile, assertAnyFolder, brightGreen, checkBinaries, cmdSwitch, cyan, error, gray, green, readJson, red, writeJson } from './common';
|
||||
import { $args, $root, $scenario, assertAnyFile, assertAnyFolder, brightGreen, checkBinaries, cmdSwitch, cyan, error, gray, green, readJson, red, writeJson } from './common';
|
||||
import { install, isolated, options } from './vscode';
|
||||
|
||||
export { install, reset } from './vscode';
|
||||
@@ -27,7 +27,6 @@ const filters = [
|
||||
/^Unexpected token A/,
|
||||
/Cannot register 'cmake.cmakePath'/,
|
||||
/\[DEP0005\] DeprecationWarning/,
|
||||
/\[DEP0169\] DeprecationWarning/,
|
||||
/--trace-deprecation/,
|
||||
/Iconv-lite warning/,
|
||||
/^Extension '/,
|
||||
@@ -76,7 +75,7 @@ filterStdio();
|
||||
async function unitTests() {
|
||||
await assertAnyFolder('dist/test/unit', `The folder '${$root}/dist/test/unit is missing. You should run ${brightGreen("yarn compile")}\n\n`);
|
||||
const mocha = await assertAnyFile(["node_modules/.bin/mocha.cmd", "node_modules/.bin/mocha"], `Can't find the mocha testrunner. You might need to run ${brightGreen("yarn install")}\n\n`);
|
||||
const result = spawnSync(mocha, [`${$root}/dist/test/unit/**/*.test.js`, '--timeout', '30000'], { stdio: 'inherit', shell: true });
|
||||
const result = spawnSync(mocha, [`${$root}/dist/test/unit/**/*.test.js`, '--timeout', '30000'], { stdio:'inherit'});
|
||||
verbose(`\n${green("NOTE:")} If you want to run a scenario test (end-to-end) use ${cmdSwitch('scenario=<NAME>')} \n\n`);
|
||||
return result.status;
|
||||
}
|
||||
@@ -91,8 +90,7 @@ async function scenarioTests(assets: string, name: string, workspace: string) {
|
||||
extensionTestsPath: resolve($root, 'dist/test/common/selectTests'),
|
||||
launchArgs: workspace ? [...options.launchArgs, workspace] : options.launchArgs,
|
||||
extensionTestsEnv: {
|
||||
SCENARIO: assets,
|
||||
SCENARIO_ARGS: $scenarioArgs.join(',')
|
||||
SCENARIO: assets
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -163,24 +161,23 @@ interface Input {
|
||||
id: string;
|
||||
type: string;
|
||||
description: string;
|
||||
options: CommentArray<{ label: string; value: string }>;
|
||||
options: CommentArray<{label: string; value: string}>;
|
||||
}
|
||||
|
||||
export async function getScenarioNames() {
|
||||
return (await readdir(`${$root}/test/scenarios`).catch(returns.none)).filter(each => each !== 'Debugger');
|
||||
}
|
||||
|
||||
export async function getScenarioFolder(scenarioName: string | undefined) {
|
||||
export async function getScenarioFolder(scenarioName: string) {
|
||||
return scenarioName ? resolve(`${$root}/test/scenarios/${(await getScenarioNames()).find(each => each.toLowerCase() === scenarioName.toLowerCase())}`) : undefined;
|
||||
}
|
||||
|
||||
export async function list() {
|
||||
console.log(`\n${cyan("Scenarios: ")}\n`);
|
||||
const names = await getScenarioNames();
|
||||
const max = names.reduce((max, each) => Math.max(max, each.length), 0);
|
||||
const max = names.reduce((max, each) => Math.max(max, each), 0);
|
||||
for (const each of names) {
|
||||
const folder = await getScenarioFolder(each);
|
||||
console.log(` ${green(each.padEnd(max))}: ${gray(folder || '')}`);
|
||||
console.log(` ${green(each.padEnd(max))}: ${gray(await getScenarioFolder(each))}`);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
"experimentalDecorators": true,
|
||||
"allowSyntheticDefaultImports": true,
|
||||
"sourceMap": true,
|
||||
"esModuleInterop": true,
|
||||
"strictNullChecks": true
|
||||
"esModuleInterop": true
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* See 'LICENSE' in the project root for license information.
|
||||
* ------------------------------------------------------------------------------------------ */
|
||||
|
||||
import { checkBinaries, checkCompiled, checkDTS, checkPrep, checkProposals, error, green } from './common';
|
||||
import { checkBinaries, checkCompiled, checkDTS, checkPrep, error, green } from './common';
|
||||
const quiet = process.argv.includes('--quiet');
|
||||
|
||||
export async function main() {
|
||||
@@ -50,12 +50,3 @@ export async function dts() {
|
||||
process.exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
export async function proposals() {
|
||||
let failing = false;
|
||||
failing = (await checkProposals() && (quiet || error(`Issue with VSCode proposals. Run ${green('yarn prep')} to fix it.`))) || failing;
|
||||
|
||||
if (failing) {
|
||||
process.exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,24 +4,20 @@
|
||||
* ------------------------------------------------------------------------------------------ */
|
||||
|
||||
import { downloadAndUnzipVSCode, resolveCliArgsFromVSCodeExecutablePath } from '@vscode/test-electron';
|
||||
import { createHash } from 'crypto';
|
||||
import { tmpdir } from 'os';
|
||||
import { resolve } from 'path';
|
||||
import { verbose } from '../src/Utility/Text/streams';
|
||||
import { mkdir, readJson, rimraf, write } from './common';
|
||||
import { getVSCodeTestIsolate } from './vscodeTestPath';
|
||||
|
||||
export const isolated = getVSCodeTestIsolate(__dirname);
|
||||
export const isolated = resolve(tmpdir(), '.vscode-test', createHash('sha256').update(__dirname).digest('hex').substring(0, 6));
|
||||
export const extensionsDir = resolve(isolated, 'extensions');
|
||||
export const userDir = resolve(isolated, 'user-data');
|
||||
export const settings = resolve(userDir, "User", 'settings.json');
|
||||
|
||||
// Pin the test VS Code build to a known-good stable release for deterministic CI instead of
|
||||
// always pulling latest. Launching macOS 1.110+ builds requires @vscode/test-electron >= 3.1.0.
|
||||
export const testVSCodeVersion = '1.131.0';
|
||||
|
||||
export const options = {
|
||||
version: testVSCodeVersion,
|
||||
cachePath: `${isolated}/cache`,
|
||||
launchArgs: ['--no-sandbox', '--disable-updates', '--skip-welcome', '--skip-release-notes', '--disable-extensions', `--extensions-dir=${extensionsDir}`, `--user-data-dir=${userDir}`, '--disable-workspace-trust']
|
||||
launchArgs: ['--no-sandbox', '--disable-updates', '--skip-welcome', '--skip-release-notes', `--extensions-dir=${extensionsDir}`, `--user-data-dir=${userDir}`, '--disable-workspace-trust']
|
||||
};
|
||||
|
||||
export async function install() {
|
||||
@@ -38,9 +34,9 @@ export async function install() {
|
||||
args.push(`--extensions-dir=${extensionsDir}`, `--user-data-dir=${userDir}`);
|
||||
|
||||
// install the appropriate extensions
|
||||
// runVSCodeCommand([...args, '--install-extension', 'ms-vscode.cpptools'], options);
|
||||
// runVSCodeCommand([...args, '--install-extension', 'twxs.cmake'], options);
|
||||
// runVSCodeCommand([...args, '--install-extension', 'ms-vscode.cmake-tools'], options);
|
||||
// spawnSync(cli, [...args, '--install-extension', 'ms-vscode.cpptools'], { encoding: 'utf-8', stdio: 'ignore' });
|
||||
// spawnSync(cli, [...args, '--install-extension', 'twxs.cmake'], { encoding: 'utf-8', stdio: 'ignore' });
|
||||
// spawnSync(cli, [...args, '--install-extension', 'ms-vscode.cmake-tools'], { encoding: 'utf-8', stdio: 'ignore' });
|
||||
const settingsJson = await readJson(settings, {});
|
||||
if (!settingsJson["workbench.colorTheme"]) {
|
||||
settingsJson["workbench.colorTheme"] = "Tomorrow Night Blue";
|
||||
|
||||
@@ -1,51 +0,0 @@
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All Rights Reserved.
|
||||
* See 'LICENSE' in the project root for license information.
|
||||
* ------------------------------------------------------------------------------------------ */
|
||||
|
||||
import { createHash } from 'crypto';
|
||||
import { homedir } from 'os';
|
||||
import { posix, win32 } from 'path';
|
||||
|
||||
function isFullyQualifiedPath(value: string, platform: NodeJS.Platform): boolean {
|
||||
const path = platform === 'win32' ? win32 : posix;
|
||||
return path.isAbsolute(value) && (platform !== 'win32' || path.parse(value).root.length > 1);
|
||||
}
|
||||
|
||||
export function getVSCodeTestIsolate(
|
||||
scriptDirectory: string,
|
||||
platform: NodeJS.Platform = process.platform,
|
||||
environment: NodeJS.ProcessEnv = process.env,
|
||||
homeDirectory: string = homedir()): string {
|
||||
const path = platform === 'win32' ? win32 : posix;
|
||||
const override = environment.CPPTOOLS_VSCODE_TEST_ROOT;
|
||||
let root: string;
|
||||
|
||||
if (override) {
|
||||
if (!isFullyQualifiedPath(override, platform)) {
|
||||
throw new Error('CPPTOOLS_VSCODE_TEST_ROOT must be a fully qualified absolute path.');
|
||||
}
|
||||
root = override;
|
||||
} else {
|
||||
switch (platform) {
|
||||
case 'win32': {
|
||||
const localAppData = environment.LOCALAPPDATA;
|
||||
const cacheDirectory = localAppData && isFullyQualifiedPath(localAppData, platform) ? localAppData : path.resolve(homeDirectory, 'AppData', 'Local');
|
||||
root = path.resolve(cacheDirectory, 'Microsoft', 'vscode-cpptools', 'vscode-test');
|
||||
break;
|
||||
}
|
||||
case 'darwin':
|
||||
root = path.resolve(homeDirectory, 'Library', 'Caches', 'vscode-cpptools', 'vscode-test');
|
||||
break;
|
||||
default: {
|
||||
const xdgCacheHome = environment.XDG_CACHE_HOME;
|
||||
const cacheDirectory = xdgCacheHome && isFullyQualifiedPath(xdgCacheHome, platform) ? xdgCacheHome : path.resolve(homeDirectory, '.cache');
|
||||
root = path.resolve(cacheDirectory, 'vscode-cpptools', 'vscode-test');
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const worktreeHash = createHash('sha256').update(scriptDirectory).digest('hex').substring(0, 6);
|
||||
return path.resolve(root, worktreeHash);
|
||||
}
|
||||
Vendored
-29
@@ -22,31 +22,6 @@
|
||||
// you can use a watch task as a prelaunch task and it works like you'd want it to.
|
||||
"preLaunchTask": "watch"
|
||||
},
|
||||
{
|
||||
// debugs the extension with sanitizer (TSan/ASan/UBSan) reports captured to files.
|
||||
// Requires a sanitizer build of the cpptools language server. Each process writes
|
||||
// ${userHome}/cpptools-sanitizer-logs/<sanitizer>.<pid> (see readme.developer.md).
|
||||
"name": "Run Extension (capture sanitizer logs)",
|
||||
"type": "extensionHost",
|
||||
"request": "launch",
|
||||
"env": {
|
||||
"CPPTOOLS_SANITIZER_LOG_DIR": "${userHome}/cpptools-sanitizer-logs"
|
||||
},
|
||||
"args": [
|
||||
"--no-sandbox",
|
||||
"--disable-updates",
|
||||
"--skip-welcome",
|
||||
"--skip-release-notes",
|
||||
"--disable-workspace-trust",
|
||||
"--extensionDevelopmentPath=${workspaceFolder}",
|
||||
],
|
||||
"sourceMaps": true,
|
||||
"outFiles": [
|
||||
"${workspaceFolder}/dist/**"
|
||||
],
|
||||
// you can use a watch task as a prelaunch task and it works like you'd want it to.
|
||||
"preLaunchTask": "watch"
|
||||
},
|
||||
{
|
||||
// debugs the extension (selecting the workspace)
|
||||
"name": "Run Extension-Select Workspace",
|
||||
@@ -122,10 +97,6 @@
|
||||
"label": "MultirootDeadlockTest ",
|
||||
"value": "${workspaceFolder}/test/scenarios/MultirootDeadlockTest/assets/test.code-workspace"
|
||||
},
|
||||
{
|
||||
"label": "RunWithoutDebugging ",
|
||||
"value": "${workspaceFolder}/test/scenarios/RunWithoutDebugging/assets/"
|
||||
},
|
||||
{
|
||||
"label": "SimpleCppProject ",
|
||||
"value": "${workspaceFolder}/test/scenarios/SimpleCppProject/assets/simpleCppProject.code-workspace"
|
||||
|
||||
Vendored
+3
-5
@@ -27,24 +27,22 @@
|
||||
"editor.formatOnSave": true,
|
||||
"editor.defaultFormatter": "vscode.json-language-features",
|
||||
"editor.tabSize": 4,
|
||||
"editor.detectIndentation": true,
|
||||
"files.insertFinalNewline": true
|
||||
},
|
||||
"[jsonc]": {
|
||||
"editor.formatOnSave": true,
|
||||
"editor.defaultFormatter": "vscode.json-language-features",
|
||||
"editor.tabSize": 4,
|
||||
"editor.detectIndentation": true,
|
||||
"files.insertFinalNewline": true
|
||||
},
|
||||
"[typescript]": {
|
||||
"editor.tabSize": 4,
|
||||
"editor.defaultFormatter": "vscode.typescript-language-features",
|
||||
"editor.defaultFormatter": "dbaeumer.vscode-eslint",
|
||||
"editor.formatOnSave": true,
|
||||
"files.insertFinalNewline": true,
|
||||
"editor.codeActionsOnSave": {
|
||||
"source.fixAll.eslint": "explicit",
|
||||
"source.organizeImports": "explicit"
|
||||
"source.fixAll.eslint": true,
|
||||
"source.organizeImports": true
|
||||
},
|
||||
},
|
||||
"eslint.format.enable": true,
|
||||
|
||||
+11
-12
@@ -29,24 +29,23 @@ jobs/**
|
||||
cgmanifest.json
|
||||
|
||||
# ignore development files
|
||||
eslint.config.js
|
||||
tsconfig.json
|
||||
test.tsconfig.json
|
||||
ui.tsconfig.json
|
||||
tslint.json
|
||||
.eslintrc.js
|
||||
webpack.config.js
|
||||
tscCompileList.txt
|
||||
gulpfile.js
|
||||
.gitattributes
|
||||
.gitignore
|
||||
gulpfile.js
|
||||
localized_string_ids.h
|
||||
readme.developer.md
|
||||
test.tsconfig.json
|
||||
translations_auto_pr.js
|
||||
tsconfig.json
|
||||
tslint.json
|
||||
tscCompileList.txt
|
||||
ui.tsconfig.json
|
||||
webpack.config.js
|
||||
CMakeLists.txt
|
||||
debugAdapters/install.lock*
|
||||
typings/**
|
||||
**/*.map
|
||||
*.d.ts
|
||||
import_edge_strings.js
|
||||
localized_string_ids.h
|
||||
translations_auto_pr.js
|
||||
|
||||
# ignore i18n language files
|
||||
i18n/**
|
||||
|
||||
-31
@@ -1,31 +0,0 @@
|
||||
{
|
||||
"name": "cpptools-yarn-bootstrap",
|
||||
"version": "1.0.0",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "cpptools-yarn-bootstrap",
|
||||
"version": "1.0.0",
|
||||
"license": "SEE LICENSE IN LICENSE.txt",
|
||||
"devDependencies": {
|
||||
"yarn": "1.22.22"
|
||||
}
|
||||
},
|
||||
"node_modules/yarn": {
|
||||
"version": "1.22.22",
|
||||
"resolved": "https://pkgs.dev.azure.com/azure-public/VisualCpp/_packaging/cpp_PublicPackages/npm/registry/yarn/-/yarn-1.22.22.tgz",
|
||||
"integrity": "sha1-rDRUnmqo5+rUY6dAfhxzkPYaZhA=",
|
||||
"dev": true,
|
||||
"hasInstallScript": true,
|
||||
"license": "BSD-2-Clause",
|
||||
"bin": {
|
||||
"yarn": "bin/yarn.js",
|
||||
"yarnpkg": "bin/yarn.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=4.0.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
{
|
||||
"name": "cpptools-yarn-bootstrap",
|
||||
"private": true,
|
||||
"version": "1.0.0",
|
||||
"description": "Install Yarn from internal npm feed for repository bootstrap.",
|
||||
"license": "SEE LICENSE IN LICENSE.txt",
|
||||
"devDependencies": {
|
||||
"yarn": "1.22.22"
|
||||
}
|
||||
}
|
||||
+1076
-704
File diff suppressed because it is too large
Load Diff
+2
-2
@@ -61,7 +61,7 @@ File questions, issues, or feature requests for the extension.
|
||||
If someone has already filed an issue that encompasses your feedback, please leave a 👍 or 👎 reaction on the issue to upvote or downvote it to help us prioritize the issue.
|
||||
<br>
|
||||
|
||||
**[Quick survey](https://aka.ms/vcvscodesurvey)**
|
||||
**[Quick survey](https://www.research.net/r/VBVV6C6)**
|
||||
<br>
|
||||
Let us know what you think of the extension by taking the quick survey.
|
||||
|
||||
@@ -75,4 +75,4 @@ This project has adopted the [Microsoft Open Source Code of Conduct](https://ope
|
||||
|
||||
## Data and telemetry
|
||||
|
||||
This extension collects usage data and sends it to Microsoft to help improve our products and services. Collection of telemetry is controlled via the same setting provided by Visual Studio Code: `"telemetry.enableTelemetry"`. Read our [privacy statement](https://go.microsoft.com/fwlink/?LinkId=521839) to learn more.
|
||||
This extension collects usage data and sends it to Microsoft to help improve our products and services. Collection of telemetry is controlled via the same setting provided by Visual Studio Code: `"telemetry.enableTelemetry"`. Read our [privacy statement](https://privacy.microsoft.com/en-us/privacystatement) to learn more.
|
||||
|
||||
+907
-1219
File diff suppressed because it is too large
Load Diff
Binary file not shown.
@@ -0,0 +1,33 @@
|
||||
{
|
||||
"defaults": [
|
||||
"cpfe",
|
||||
"--wchar_t_keyword",
|
||||
"--no_warnings",
|
||||
"--rtti",
|
||||
"--edge",
|
||||
"--exceptions",
|
||||
"--error_limit",
|
||||
"25000",
|
||||
"-D_EDG_COMPILER",
|
||||
"-D_USE_DECLSPECS_FOR_SAL=1"
|
||||
],
|
||||
"source_file_format": "-f %s",
|
||||
"expressions": [
|
||||
{
|
||||
"match": "^/I(.*)",
|
||||
"replace": "-I\n$1"
|
||||
},
|
||||
{
|
||||
"match": "^/D(.*)",
|
||||
"replace": "-D$1"
|
||||
},
|
||||
{
|
||||
"match": "^/AI(.*)",
|
||||
"replace": "--using_directory\n$1"
|
||||
},
|
||||
{
|
||||
"match": "^/dE--(.*)",
|
||||
"replace": "--$1"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"defaults": [
|
||||
"--pack_alignment",
|
||||
"8",
|
||||
"-Dunix=1",
|
||||
"-D__unix__=1",
|
||||
"-D__linux__=1",
|
||||
"-D__arm__=1",
|
||||
"-D__ARM_32BIT_STATE=1",
|
||||
"-D__PTRDIFF_TYPE__=int",
|
||||
"-D__SIZE_TYPE__=unsigned int",
|
||||
"-D__WCHAR_TYPE__=long int"
|
||||
],
|
||||
"defaults_op" : "merge"
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"defaults": [
|
||||
"--pack_alignment",
|
||||
"8",
|
||||
"-Dunix=1",
|
||||
"-D__unix__=1",
|
||||
"-D__linux__=1",
|
||||
"-D__aarch64__=1",
|
||||
"-D__ARM_64BIT_STATE=1",
|
||||
"-D__PTRDIFF_TYPE__=long int",
|
||||
"-D__SIZE_TYPE__=long unsigned int",
|
||||
"-D__WCHAR_TYPE__=int"
|
||||
],
|
||||
"defaults_op" : "merge"
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"defaults": [
|
||||
"--pack_alignment",
|
||||
"8",
|
||||
"-Dunix=1",
|
||||
"-D__unix__=1",
|
||||
"-D__linux__=1",
|
||||
"-D__x86_64=1",
|
||||
"-D__x86_64__=1",
|
||||
"-D__PTRDIFF_TYPE__=long int",
|
||||
"-D__SIZE_TYPE__=long unsigned int",
|
||||
"-D__WCHAR_TYPE__=int"
|
||||
],
|
||||
"defaults_op" : "merge"
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"defaults": [
|
||||
"--pack_alignment",
|
||||
"8",
|
||||
"-Dunix=1",
|
||||
"-D__unix__=1",
|
||||
"-D__linux__=1",
|
||||
"-D__i386=1",
|
||||
"-D__i386__=1",
|
||||
"-D__PTRDIFF_TYPE__=int",
|
||||
"-D__SIZE_TYPE__=unsigned int",
|
||||
"-D__WCHAR_TYPE__=long int"
|
||||
],
|
||||
"defaults_op" : "merge"
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"defaults": [
|
||||
"--pack_alignment",
|
||||
"8",
|
||||
"-Dunix=1",
|
||||
"-D__unix__=1",
|
||||
"-D__linux__=1",
|
||||
"-D__arm__=1",
|
||||
"-D__ARM_32BIT_STATE=1",
|
||||
"-D__PTRDIFF_TYPE__=int",
|
||||
"-D__SIZE_TYPE__=unsigned int",
|
||||
"-D__WCHAR_TYPE__=long int"
|
||||
],
|
||||
"defaults_op" : "merge"
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"defaults": [
|
||||
"--pack_alignment",
|
||||
"8",
|
||||
"-Dunix=1",
|
||||
"-D__unix__=1",
|
||||
"-D__linux__=1",
|
||||
"-D__aarch64__=1",
|
||||
"-D__ARM_64BIT_STATE=1",
|
||||
"-D__PTRDIFF_TYPE__=long int",
|
||||
"-D__SIZE_TYPE__=long unsigned int",
|
||||
"-D__WCHAR_TYPE__=int"
|
||||
],
|
||||
"defaults_op" : "merge"
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"defaults": [
|
||||
"--pack_alignment",
|
||||
"8",
|
||||
"-Dunix=1",
|
||||
"-D__unix__=1",
|
||||
"-D__linux__=1",
|
||||
"-D__x86_64=1",
|
||||
"-D__x86_64__=1",
|
||||
"-D__PTRDIFF_TYPE__=long int",
|
||||
"-D__SIZE_TYPE__=long unsigned int",
|
||||
"-D__WCHAR_TYPE__=int"
|
||||
],
|
||||
"defaults_op" : "merge"
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"defaults": [
|
||||
"--pack_alignment",
|
||||
"8",
|
||||
"-Dunix=1",
|
||||
"-D__unix__=1",
|
||||
"-D__linux__=1",
|
||||
"-D__i386=1",
|
||||
"-D__i386__=1",
|
||||
"-D__PTRDIFF_TYPE__=int",
|
||||
"-D__SIZE_TYPE__=unsigned int",
|
||||
"-D__WCHAR_TYPE__=long int"
|
||||
],
|
||||
"defaults_op" : "merge"
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"defaults": [
|
||||
"--pack_alignment",
|
||||
"8",
|
||||
"-D__APPLE__=1",
|
||||
"-D__MACH__=1",
|
||||
"-D__arm__=1",
|
||||
"-D__ARM_32BIT_STATE=1",
|
||||
"-D__PTRDIFF_TYPE__=int",
|
||||
"-D__SIZE_TYPE__=unsigned int",
|
||||
"-D__WCHAR_TYPE__=long int"
|
||||
],
|
||||
"defaults_op" : "merge"
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"defaults": [
|
||||
"--pack_alignment",
|
||||
"8",
|
||||
"-D__APPLE__=1",
|
||||
"-D__MACH__=1",
|
||||
"-D__aarch64__=1",
|
||||
"-D__ARM_64BIT_STATE=1",
|
||||
"-D__PTRDIFF_TYPE__=long int",
|
||||
"-D__SIZE_TYPE__=long unsigned int",
|
||||
"-D__WCHAR_TYPE__=int"
|
||||
],
|
||||
"defaults_op" : "merge"
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"defaults": [
|
||||
"--pack_alignment",
|
||||
"8",
|
||||
"-D__APPLE__=1",
|
||||
"-D__MACH__=1",
|
||||
"-D__x86_64=1",
|
||||
"-D__x86_64__=1",
|
||||
"-D__PTRDIFF_TYPE__=long int",
|
||||
"-D__SIZE_TYPE__=long unsigned int",
|
||||
"-D__WCHAR_TYPE__=int"
|
||||
],
|
||||
"defaults_op" : "merge"
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"defaults": [
|
||||
"--pack_alignment",
|
||||
"8",
|
||||
"-D__APPLE__=1",
|
||||
"-D__MACH__=1",
|
||||
"-D__i386=1",
|
||||
"-D__i386__=1",
|
||||
"-D__PTRDIFF_TYPE__=int",
|
||||
"-D__SIZE_TYPE__=unsigned int",
|
||||
"-D__WCHAR_TYPE__=long int"
|
||||
],
|
||||
"defaults_op" : "merge"
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"defaults": [
|
||||
"--pack_alignment",
|
||||
"8",
|
||||
"-D__APPLE__=1",
|
||||
"-D__MACH__=1",
|
||||
"-D__arm__=1",
|
||||
"-D__ARM_32BIT_STATE=1",
|
||||
"-D__PTRDIFF_TYPE__=int",
|
||||
"-D__SIZE_TYPE__=unsigned int",
|
||||
"-D__WCHAR_TYPE__=long int"
|
||||
],
|
||||
"defaults_op" : "merge"
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user