mirror of
https://github.com/graalvm/setup-graalvm.git
synced 2025-07-04 08:43:15 +08:00
add logging for debugging
This commit is contained in:
parent
55a1a57dc2
commit
7e534b7e1c
21
dist/cleanup/index.js
generated
vendored
21
dist/cleanup/index.js
generated
vendored
@ -81867,19 +81867,19 @@ function generateReports() {
|
||||
if (areMetricHistoriesEnabled()) {
|
||||
const pushEvents = yield (0, utils_1.getPushEvents)(getBuildCountsForMetricHistory());
|
||||
// Prepare data
|
||||
const timestamps = [];
|
||||
// const timestamps = []
|
||||
const shas = [];
|
||||
core.info("pushEvents: " + pushEvents[0].created_at);
|
||||
// core.info("pushEvents: " + pushEvents[0].created_at)
|
||||
for (let i = 0; i < pushEvents.length; i++) {
|
||||
timestamps.push(pushEvents[i].created_at);
|
||||
// timestamps.push(pushEvents[i].created_at)
|
||||
core.info("------------------------------------");
|
||||
core.info(pushEvents[i].created_at);
|
||||
shas.push(pushEvents[i].payload.commits[0].sha);
|
||||
}
|
||||
// Extract data for plotting
|
||||
const commitDates = (0, utils_1.formatTimestamps)(timestamps);
|
||||
// const commitDates = formatTimestamps(timestamps)
|
||||
const imageData = (0, utils_1.getImageData)(shas);
|
||||
core.info(String(commitDates));
|
||||
// core.info(String(commitDates))
|
||||
core.info(String(shas));
|
||||
core.info(String(imageData));
|
||||
}
|
||||
@ -82514,7 +82514,6 @@ function getPushEvents(numberOfBuilds) {
|
||||
let linkHeader = eventResponse.headers.link;
|
||||
const eventData = eventResponse.data;
|
||||
const pushEvents = [];
|
||||
core.info("1: " + linkHeader + eventData + JSON.stringify(eventResponse));
|
||||
/* for (const gitEvent in eventData ) {
|
||||
if (numberOfBuilds <= 0) {
|
||||
break
|
||||
@ -82536,7 +82535,6 @@ function getPushEvents(numberOfBuilds) {
|
||||
event.payload.ref === process.env.GITHUB_REF) {
|
||||
pushEvents.push(event);
|
||||
numberOfBuilds--;
|
||||
core.info("2");
|
||||
}
|
||||
}
|
||||
let nextPageMatch = /<([^>]+)>;\s*rel="next"/;
|
||||
@ -82544,7 +82542,6 @@ function getPushEvents(numberOfBuilds) {
|
||||
linkHeader.includes('rel="next"') &&
|
||||
numberOfBuilds > 0) {
|
||||
let nextPageUrl = nextPageMatch === null || nextPageMatch === void 0 ? void 0 : nextPageMatch.exec(linkHeader)[1];
|
||||
core.info("3");
|
||||
// Make the request for the next page
|
||||
// Assuming you use fetch API or similar for making HTTP requests
|
||||
(0, node_fetch_1.default)(nextPageUrl, {
|
||||
@ -82562,7 +82559,6 @@ function getPushEvents(numberOfBuilds) {
|
||||
event.payload.ref === process.env.GITHUB_REF) {
|
||||
pushEvents.push(event);
|
||||
numberOfBuilds--;
|
||||
core.info("4");
|
||||
}
|
||||
}
|
||||
// Update the link_header for the next iteration
|
||||
@ -82570,16 +82566,13 @@ function getPushEvents(numberOfBuilds) {
|
||||
})
|
||||
.catch((error) => {
|
||||
console.error("Error fetching next page:", error);
|
||||
core.info("5");
|
||||
});
|
||||
}
|
||||
core.info("7: " + JSON.stringify(pushEvents));
|
||||
return pushEvents;
|
||||
}
|
||||
catch (err) {
|
||||
return [];
|
||||
core.info("6");
|
||||
console.info("An error occurred during getting metrics data.");
|
||||
return [];
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -82606,7 +82599,9 @@ function getImageData(shas) {
|
||||
},
|
||||
});
|
||||
const imageData = [];
|
||||
core.info(String(shas));
|
||||
for (const sha in shas) {
|
||||
core.info(sha);
|
||||
const blobTreeSha = yield getBlobTreeSha(octokit, context, sha);
|
||||
const blobSha = yield getBlobSha(octokit, context, blobTreeSha);
|
||||
imageData.push(yield getBlobContent(octokit, context, blobSha));
|
||||
|
21
dist/main/index.js
generated
vendored
21
dist/main/index.js
generated
vendored
@ -81966,19 +81966,19 @@ function generateReports() {
|
||||
if (areMetricHistoriesEnabled()) {
|
||||
const pushEvents = yield (0, utils_1.getPushEvents)(getBuildCountsForMetricHistory());
|
||||
// Prepare data
|
||||
const timestamps = [];
|
||||
// const timestamps = []
|
||||
const shas = [];
|
||||
core.info("pushEvents: " + pushEvents[0].created_at);
|
||||
// core.info("pushEvents: " + pushEvents[0].created_at)
|
||||
for (let i = 0; i < pushEvents.length; i++) {
|
||||
timestamps.push(pushEvents[i].created_at);
|
||||
// timestamps.push(pushEvents[i].created_at)
|
||||
core.info("------------------------------------");
|
||||
core.info(pushEvents[i].created_at);
|
||||
shas.push(pushEvents[i].payload.commits[0].sha);
|
||||
}
|
||||
// Extract data for plotting
|
||||
const commitDates = (0, utils_1.formatTimestamps)(timestamps);
|
||||
// const commitDates = formatTimestamps(timestamps)
|
||||
const imageData = (0, utils_1.getImageData)(shas);
|
||||
core.info(String(commitDates));
|
||||
// core.info(String(commitDates))
|
||||
core.info(String(shas));
|
||||
core.info(String(imageData));
|
||||
}
|
||||
@ -83590,7 +83590,6 @@ function getPushEvents(numberOfBuilds) {
|
||||
let linkHeader = eventResponse.headers.link;
|
||||
const eventData = eventResponse.data;
|
||||
const pushEvents = [];
|
||||
core.info("1: " + linkHeader + eventData + JSON.stringify(eventResponse));
|
||||
/* for (const gitEvent in eventData ) {
|
||||
if (numberOfBuilds <= 0) {
|
||||
break
|
||||
@ -83612,7 +83611,6 @@ function getPushEvents(numberOfBuilds) {
|
||||
event.payload.ref === process.env.GITHUB_REF) {
|
||||
pushEvents.push(event);
|
||||
numberOfBuilds--;
|
||||
core.info("2");
|
||||
}
|
||||
}
|
||||
let nextPageMatch = /<([^>]+)>;\s*rel="next"/;
|
||||
@ -83620,7 +83618,6 @@ function getPushEvents(numberOfBuilds) {
|
||||
linkHeader.includes('rel="next"') &&
|
||||
numberOfBuilds > 0) {
|
||||
let nextPageUrl = nextPageMatch === null || nextPageMatch === void 0 ? void 0 : nextPageMatch.exec(linkHeader)[1];
|
||||
core.info("3");
|
||||
// Make the request for the next page
|
||||
// Assuming you use fetch API or similar for making HTTP requests
|
||||
(0, node_fetch_1.default)(nextPageUrl, {
|
||||
@ -83638,7 +83635,6 @@ function getPushEvents(numberOfBuilds) {
|
||||
event.payload.ref === process.env.GITHUB_REF) {
|
||||
pushEvents.push(event);
|
||||
numberOfBuilds--;
|
||||
core.info("4");
|
||||
}
|
||||
}
|
||||
// Update the link_header for the next iteration
|
||||
@ -83646,16 +83642,13 @@ function getPushEvents(numberOfBuilds) {
|
||||
})
|
||||
.catch((error) => {
|
||||
console.error("Error fetching next page:", error);
|
||||
core.info("5");
|
||||
});
|
||||
}
|
||||
core.info("7: " + JSON.stringify(pushEvents));
|
||||
return pushEvents;
|
||||
}
|
||||
catch (err) {
|
||||
return [];
|
||||
core.info("6");
|
||||
console.info("An error occurred during getting metrics data.");
|
||||
return [];
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -83682,7 +83675,9 @@ function getImageData(shas) {
|
||||
},
|
||||
});
|
||||
const imageData = [];
|
||||
core.info(String(shas));
|
||||
for (const sha in shas) {
|
||||
core.info(sha);
|
||||
const blobTreeSha = yield getBlobTreeSha(octokit, context, sha);
|
||||
const blobSha = yield getBlobSha(octokit, context, blobTreeSha);
|
||||
imageData.push(yield getBlobContent(octokit, context, blobSha));
|
||||
|
@ -152,20 +152,20 @@ export async function generateReports(): Promise<void> {
|
||||
if (areMetricHistoriesEnabled()) {
|
||||
const pushEvents = await getPushEvents(getBuildCountsForMetricHistory())
|
||||
// Prepare data
|
||||
const timestamps = []
|
||||
// const timestamps = []
|
||||
const shas = []
|
||||
core.info("pushEvents: " + pushEvents[0].created_at)
|
||||
// core.info("pushEvents: " + pushEvents[0].created_at)
|
||||
for (let i=0; i < pushEvents.length; i++) {
|
||||
timestamps.push(pushEvents[i].created_at)
|
||||
// timestamps.push(pushEvents[i].created_at)
|
||||
core.info("------------------------------------")
|
||||
core.info(pushEvents[i].created_at)
|
||||
shas.push(pushEvents[i].payload.commits[0].sha)
|
||||
}
|
||||
|
||||
// Extract data for plotting
|
||||
const commitDates = formatTimestamps(timestamps)
|
||||
// const commitDates = formatTimestamps(timestamps)
|
||||
const imageData = getImageData(shas)
|
||||
core.info(String(commitDates))
|
||||
// core.info(String(commitDates))
|
||||
core.info(String(shas))
|
||||
core.info(String(imageData))
|
||||
|
||||
|
11
src/utils.ts
11
src/utils.ts
@ -318,7 +318,6 @@ export async function getPushEvents(numberOfBuilds: number): Promise<any[]> {
|
||||
let linkHeader = eventResponse.headers.link
|
||||
const eventData: any = eventResponse.data
|
||||
const pushEvents = []
|
||||
core.info("1: " + linkHeader + eventData + JSON.stringify(eventResponse))
|
||||
|
||||
/* for (const gitEvent in eventData ) {
|
||||
if (numberOfBuilds <= 0) {
|
||||
@ -343,7 +342,6 @@ export async function getPushEvents(numberOfBuilds: number): Promise<any[]> {
|
||||
) {
|
||||
pushEvents.push(event);
|
||||
numberOfBuilds--;
|
||||
core.info("2")
|
||||
}
|
||||
}
|
||||
|
||||
@ -354,7 +352,6 @@ export async function getPushEvents(numberOfBuilds: number): Promise<any[]> {
|
||||
numberOfBuilds > 0
|
||||
) {
|
||||
let nextPageUrl = nextPageMatch?.exec(linkHeader)![1];
|
||||
core.info("3")
|
||||
// Make the request for the next page
|
||||
// Assuming you use fetch API or similar for making HTTP requests
|
||||
fetch(nextPageUrl, {
|
||||
@ -374,7 +371,6 @@ export async function getPushEvents(numberOfBuilds: number): Promise<any[]> {
|
||||
) {
|
||||
pushEvents.push(event);
|
||||
numberOfBuilds--;
|
||||
core.info("4")
|
||||
}
|
||||
}
|
||||
|
||||
@ -383,15 +379,12 @@ export async function getPushEvents(numberOfBuilds: number): Promise<any[]> {
|
||||
})
|
||||
.catch((error) => {
|
||||
console.error("Error fetching next page:", error);
|
||||
core.info("5")
|
||||
});
|
||||
}
|
||||
core.info("7: " + JSON.stringify(pushEvents))
|
||||
return pushEvents
|
||||
} catch (err) {
|
||||
return []
|
||||
core.info("6")
|
||||
console.info("An error occurred during getting metrics data.")
|
||||
return []
|
||||
}
|
||||
}
|
||||
|
||||
@ -416,7 +409,9 @@ export async function getImageData(shas: string[]) {
|
||||
},
|
||||
});
|
||||
const imageData = []
|
||||
core.info(String(shas))
|
||||
for (const sha in shas) {
|
||||
core.info(sha)
|
||||
const blobTreeSha = await getBlobTreeSha(octokit, context, sha)
|
||||
const blobSha = await getBlobSha(octokit, context, blobTreeSha)
|
||||
imageData.push(await getBlobContent(octokit, context, blobSha))
|
||||
|
Loading…
x
Reference in New Issue
Block a user