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
1 change: 1 addition & 0 deletions actions/setup/js/add_comment.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -559,6 +559,7 @@ async function main(config = {}) {
// Add metadata for tracking (includes comment ID, item number, and repo info)
// This is used by the handler manager to track comments with unresolved temp IDs
try {
// @ts-ignore - Add tracking metadata to comment object (works with both REST and GraphQL responses)
comment._tracking = {
commentId: comment.id,
itemNumber: itemNumber,
Expand Down
10 changes: 5 additions & 5 deletions actions/setup/js/add_labels.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const { processSafeOutput } = require("./safe_output_processor.cjs");
const { validateLabels } = require("./safe_output_validator.cjs");
const { getErrorMessage } = require("./error_helpers.cjs");

async function main(config = {}) {
async function main(handlerConfig = {}) {
// Use shared processor for common steps
const result = await processSafeOutput(
{
Expand All @@ -17,9 +17,9 @@ async function main(config = {}) {
supportsIssue: true,
envVars: {
// Config values now passed via config object, not env vars
allowed: null,
maxCount: null,
target: null,
allowed: undefined,
maxCount: undefined,
target: undefined,
},
},
{
Expand All @@ -38,7 +38,7 @@ async function main(config = {}) {
return content;
},
},
config // Pass handler config as third parameter
handlerConfig // Pass handler config as third parameter
);

if (!result.success) {
Expand Down
4 changes: 3 additions & 1 deletion actions/setup/js/safe_output_handler_manager.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ async function loadHandlers(config) {
*
* @param {Map<string, Function>} messageHandlers - Map of message handler functions
* @param {Array<Object>} messages - Array of safe output messages
* @returns {Promise<{success: boolean, results: Array<any>, temporaryIdMap: Map, pendingUpdates: Array<any>}>}
* @returns {Promise<{success: boolean, results: Array<any>, temporaryIdMap: Object, outputsWithUnresolvedIds: Array<any>}>}
*/
async function processMessages(messageHandlers, messages) {
const results = [];
Expand Down Expand Up @@ -387,6 +387,7 @@ async function processSyntheticUpdates(github, context, trackedOutputs, temporar
const contentToCheck = getContentToCheck(tracked.type, tracked.message);

// Check if the content still has unresolved IDs (some may now be resolved)
// @ts-ignore - hasUnresolvedTemporaryIds handles null values
const stillHasUnresolved = hasUnresolvedTemporaryIds(contentToCheck, temporaryIdMap);
const resolvedCount = temporaryIdMap.size - tracked.originalTempIdMapSize;

Expand All @@ -397,6 +398,7 @@ async function processSyntheticUpdates(github, context, trackedOutputs, temporar

try {
// Replace temporary ID references with resolved values
// @ts-ignore - replaceTemporaryIdReferences handles null values
const updatedContent = replaceTemporaryIdReferences(contentToCheck, temporaryIdMap, tracked.result.repo);

// Update based on the original type
Expand Down
3 changes: 2 additions & 1 deletion actions/setup/js/update_runner.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,9 @@ const { getErrorMessage } = require("./error_helpers.cjs");
* @property {boolean} supportsStatus - Whether this type supports status updates
* @property {boolean} supportsOperation - Whether this type supports operation (append/prepend/replace)
* @property {(item: any, index: number) => string} renderStagedItem - Function to render item for staged preview
* @property {(github: any, context: any, targetNumber: number, updateData: any) => Promise<any>} executeUpdate - Function to execute the update API call
* @property {(github: any, context: any, targetNumber: number, updateData: any, handlerConfig?: any) => Promise<any>} executeUpdate - Function to execute the update API call
* @property {(result: any) => string} getSummaryLine - Function to generate summary line for an updated item
* @property {any} [handlerConfig] - Optional handler configuration object passed from handler manager
*/

/**
Expand Down