mirror of
https://github.com/github/awesome-copilot.git
synced 2026-10-15 08:11:44 +00:00
Publish full external plugin quality gate logs (#3668)
* fix(external-plugins): publish full quality gate logs Upload full external plugin quality gate output as workflow artifacts and link those artifacts from PR and intake comments. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> * Limit safeName length to 64 characters Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
co-authored by
Copilot App
Copilot Autofix powered by AI
parent
1874d1b88b
commit
a89cd67e19
@@ -2,6 +2,7 @@ import assert from "node:assert/strict";
|
||||
import http from "node:http";
|
||||
import { afterEach, test } from "node:test";
|
||||
import {
|
||||
applyQualityGateResult,
|
||||
evaluateExternalPluginIssue,
|
||||
PinnedAddressDispatcher,
|
||||
validateCanvasPluginMetadata,
|
||||
@@ -15,6 +16,34 @@ const TREE_PLUGINS = "tree-plugins";
|
||||
const TREE_UPGRADE_AGENT = "tree-upgrade-agent";
|
||||
const TREE_EXTENSIONS = "tree-extensions";
|
||||
|
||||
test("applyQualityGateResult links the full quality log artifact", () => {
|
||||
const artifactUrl = "https://github.com/github/awesome-copilot/actions/runs/123/artifacts/456";
|
||||
const result = applyQualityGateResult(
|
||||
{
|
||||
valid: true,
|
||||
plugin: {
|
||||
name: "example-plugin",
|
||||
repository: "https://github.com/example/plugin",
|
||||
source: { repo: "example/plugin", ref: "v1.0.0" },
|
||||
},
|
||||
warnings: [],
|
||||
},
|
||||
{
|
||||
overall_status: "fail",
|
||||
failure_class: "submitter_fixes",
|
||||
vally_lint_status: "fail",
|
||||
vally_lint_output: "...output truncated...",
|
||||
},
|
||||
123,
|
||||
"github",
|
||||
"awesome-copilot",
|
||||
artifactUrl,
|
||||
);
|
||||
|
||||
assert.match(result.commentBody, /Download full quality gate logs/);
|
||||
assert.match(result.commentBody, new RegExp(artifactUrl.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")));
|
||||
});
|
||||
|
||||
function fileNode(content) {
|
||||
return { type: "file", content: Buffer.from(content, "utf8").toString("base64") };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user