Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 17 additions & 17 deletions actions/setup/js/handle_noop_message.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ const { renderTemplate } = require("./messages_core.cjs");
*/
async function ensureAgentRunsIssue() {
Copy link

Copilot AI Feb 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The helper name ensureAgentRunsIssue no longer matches its behavior (it now searches/creates the "[agentic-workflows] No-Op Runs" issue). Please rename the function/export (and any callers) to reflect no-op runs, and update any remaining in-file comments/log text that still refer to an "agent runs" issue to avoid confusion during debugging.

This issue also appears on line 146 of the same file.

Suggested change
async function ensureAgentRunsIssue() {
async function ensureNoOpRunsIssue() {

Copilot uses AI. Check for mistakes.
const { owner, repo } = context.repo;
const parentTitle = "[agentic-workflows] Agent runs";
const parentTitle = "[agentic-workflows] No-Op Runs";
const parentLabel = "agentic-workflows";

core.info(`Searching for agent runs issue: "${parentTitle}"`);
core.info(`Searching for no-op runs issue: "${parentTitle}"`);

// Search for existing agent runs issue
// Search for existing no-op runs issue
const searchQuery = `repo:${owner}/${repo} is:issue is:open label:${parentLabel} in:title "${parentTitle}"`;

try {
Expand All @@ -28,19 +28,19 @@ async function ensureAgentRunsIssue() {

if (searchResult.data.total_count > 0) {
const existingIssue = searchResult.data.items[0];
core.info(`Found existing agent runs issue #${existingIssue.number}: ${existingIssue.html_url}`);
core.info(`Found existing no-op runs issue #${existingIssue.number}: ${existingIssue.html_url}`);

return {
number: existingIssue.number,
node_id: existingIssue.node_id,
};
}
} catch (error) {
core.warning(`Error searching for agent runs issue: ${getErrorMessage(error)}`);
core.warning(`Error searching for no-op runs issue: ${getErrorMessage(error)}`);
}

// Create agent runs issue if it doesn't exist
core.info(`No agent runs issue found, creating one`);
// Create no-op runs issue if it doesn't exist
core.info(`No no-op runs issue found, creating one`);

let parentBodyContent = `This issue tracks all no-op runs from agentic workflows in this repository. Each workflow run that completes with a no-op message (indicating no action was needed) posts a comment here.

Expand Down Expand Up @@ -85,13 +85,13 @@ These are successful outcomes, not failures, and help provide transparency into
labels: [parentLabel],
});

core.info(`✓ Created agent runs issue #${newIssue.data.number}: ${newIssue.data.html_url}`);
core.info(`✓ Created no-op runs issue #${newIssue.data.number}: ${newIssue.data.html_url}`);
return {
number: newIssue.data.number,
node_id: newIssue.data.node_id,
};
} catch (error) {
core.error(`Failed to create agent runs issue: ${getErrorMessage(error)}`);
core.error(`Failed to create no-op runs issue: ${getErrorMessage(error)}`);
throw error;
}
}
Expand Down Expand Up @@ -143,16 +143,16 @@ async function main() {
return;
}

core.info("Agent succeeded with only noop outputs - posting to agent runs issue");
core.info("Agent succeeded with only noop outputs - posting to no-op runs issue");

const { owner, repo } = context.repo;

// Ensure agent runs issue exists
let agentRunsIssue;
// Ensure no-op runs issue exists
let noopRunsIssue;
try {
agentRunsIssue = await ensureAgentRunsIssue();
noopRunsIssue = await ensureAgentRunsIssue();
} catch (error) {
core.warning(`Could not create agent runs issue: ${getErrorMessage(error)}`);
core.warning(`Could not create no-op runs issue: ${getErrorMessage(error)}`);
// Don't fail the workflow if we can't create the issue
return;
}
Expand Down Expand Up @@ -186,13 +186,13 @@ ${sanitizeContent(noopMessage)}
await github.rest.issues.createComment({
owner,
repo,
issue_number: agentRunsIssue.number,
issue_number: noopRunsIssue.number,
body: fullCommentBody,
});

core.info(`✓ Posted no-op message to agent runs issue #${agentRunsIssue.number}`);
core.info(`✓ Posted no-op message to no-op runs issue #${noopRunsIssue.number}`);
} catch (error) {
core.warning(`Failed to post comment to agent runs issue: ${getErrorMessage(error)}`);
core.warning(`Failed to post comment to no-op runs issue: ${getErrorMessage(error)}`);
// Don't fail the workflow
}
} catch (error) {
Expand Down
10 changes: 5 additions & 5 deletions actions/setup/js/handle_noop_message.test.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ describe("handle_noop_message", () => {
expect(mockGithub.rest.search.issuesAndPullRequests).not.toHaveBeenCalled();
});

it("should create agent runs issue if it doesn't exist", async () => {
it("should create no-op runs issue if it doesn't exist", async () => {
process.env.GH_AW_WORKFLOW_NAME = "Test Workflow";
process.env.GH_AW_RUN_URL = "https://github.com/test-owner/test-repo/actions/runs/123456";
process.env.GH_AW_NOOP_MESSAGE = "No updates needed";
Expand Down Expand Up @@ -163,13 +163,13 @@ describe("handle_noop_message", () => {

// Verify search was performed
expect(mockGithub.rest.search.issuesAndPullRequests).toHaveBeenCalledWith({
q: expect.stringContaining("[agentic-workflows] Agent runs"),
q: expect.stringContaining("[agentic-workflows] No-Op Runs"),
per_page: 1,
});

// Verify issue was created with correct title
const createCall = mockGithub.rest.issues.create.mock.calls[0][0];
expect(createCall.title).toBe("[agentic-workflows] Agent runs");
expect(createCall.title).toBe("[agentic-workflows] No-Op Runs");
expect(createCall.labels).toContain("agentic-workflows");
expect(createCall.body).toContain("tracks all no-op runs");

Expand All @@ -181,7 +181,7 @@ describe("handle_noop_message", () => {
expect(commentCall.body).toContain("123456");
});

it("should use existing agent runs issue if it exists", async () => {
it("should use existing no-op runs issue if it exists", async () => {
process.env.GH_AW_WORKFLOW_NAME = "Another Workflow";
process.env.GH_AW_RUN_URL = "https://github.com/test-owner/test-repo/actions/runs/789";
process.env.GH_AW_NOOP_MESSAGE = "Everything is up to date";
Expand Down Expand Up @@ -294,7 +294,7 @@ describe("handle_noop_message", () => {
await main();

// Verify warning was logged but workflow didn't fail
expect(mockCore.warning).toHaveBeenCalledWith(expect.stringContaining("Could not create agent runs issue"));
expect(mockCore.warning).toHaveBeenCalledWith(expect.stringContaining("Could not create no-op runs issue"));
});

it("should extract run ID from URL correctly", async () => {
Expand Down