Skip to content

Commit

Permalink
jira cant process arrays of arrays
Browse files Browse the repository at this point in the history
  • Loading branch information
TaylorFries committed Nov 7, 2024
1 parent c4b2a9a commit 247739d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ export const createAndCloseExistingIssue = async (issueTitle, issueBody, issueCo
// Check for existing Issue.
const existingIssueNumber = await findIssueByTitle(issueTitle);

console.log(typeof issueComment);
console.log(issueComment);

if (existingIssueNumber && !Number.isNaN(Number(existingIssueNumber))) {
// Close old Issue.
await closeIssue(Number(existingIssueNumber));
Expand All @@ -20,12 +17,13 @@ export const createAndCloseExistingIssue = async (issueTitle, issueBody, issueCo
// Create new Issue.
await createIssue(issueTitle, decodeURIComponent(issueBody));

setTimeout(() => console.log("pausing for issue to be created..."), 2000);
setTimeout(() => console.log("pausing for issue to be created..."), 1500);

// get the issue number for the issue just created
const newIssueNumber = await findIssueByTitle(issueTitle);

// Add comment to Issue.
await addComment(newIssueNumber, issueComment);
await addComment(newIssueNumber, JSON.stringify(issueComment));
};

export default createAndCloseExistingIssue;
5 changes: 4 additions & 1 deletion .github/helpers/npm-deps/create-report-issues.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,16 @@ const outputText = require(path.resolve(__dirname, `../../../outputText.json`));

// Get package.json paths and comment contents from env.
const packageJsonPaths = JSON.parse(process.env.packageJsonPaths);
const comment = process.env.commentContents;
const commentIn = JSON.parse(process.env.commentContents);

(async () => {
const module = await import('../github-api/create-and-close-existing-issue.mjs');
const createAndCloseExistingIssue = module.default;
// Create an array of promises for each packageJsonPath.
const promises = packageJsonPaths.map(async (packagePath) => {
// get the comment for this folder
const comment = commentIn[packagePath];
// create title
const issueTitle =
packagePath !== '.' ? `${packagePath} NPM Dependency Report` : 'NPM Dependency Report';
// Await the completion of create and close existing issue.
Expand Down
7 changes: 3 additions & 4 deletions .github/helpers/npm-deps/parse_to_comment.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,14 @@
}
Sample Output:
{ "folder1": { "count": <number_folder1_deps>,
"patch": { "count": <num_patch_deps>,
{ "folder1": { "patch": { "count": <num_patch_deps>,
"updateCmd": <string to update all patch deps>,
"detailedList":[ "Update <dep1_name> from <cur_ver> to <update_to>",
... ,
"Update <depN_name> from <cur_ver> to <update_to>"
] },
"minor": { ... },
"major": { ... } },
"major": { ... } ],
... ,
"folderN": { ... } }
Expand Down Expand Up @@ -280,7 +279,7 @@ def create_update_dict(folder, outdated_json):
return WARNING

# define return dictionary and set count
return_dict = {"count": len(patch_li) + len(minor_li) + len(major_li)}
return_dict = {}

if S_PATCH in LEVELS and len(patch_li) > 0:
# if we are reporting on patch and there are updates include that section
Expand Down

0 comments on commit 247739d

Please sign in to comment.