forked from espressif/esp-idf
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(ci): add retry job functionality to dynamic pipeline report
Introduced changes: - add a manual ci job to retry failed jobs. - refactor js scripts in report template - extract the CI ENV vars related to the report generation script to the predefined constants.py module - introduce a new action "retry_failed_jobs" in helper script "gitlab_api.py"
- Loading branch information
1 parent
f08926b
commit a6b84b5
Showing
13 changed files
with
512 additions
and
307 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,6 +12,7 @@ stages: | |
- test_deploy | ||
- deploy | ||
- post_deploy | ||
- retry_failed_jobs | ||
|
||
variables: | ||
# System environment | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
retry_failed_jobs: | ||
stage: retry_failed_jobs | ||
tags: [shiny, fast_run] | ||
image: $ESP_ENV_IMAGE | ||
dependencies: null | ||
before_script: [] | ||
cache: [] | ||
extends: [] | ||
script: | ||
- echo "Retrieving and retrying all failed jobs for the pipeline..." | ||
- python tools/ci/python_packages/gitlab_api.py retry_failed_jobs $CI_MERGE_REQUEST_PROJECT_ID --pipeline_id $CI_PIPELINE_ID | ||
when: manual | ||
needs: | ||
- generate_failed_jobs_report |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
214 changes: 129 additions & 85 deletions
214
tools/ci/dynamic_pipelines/templates/report.template.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,88 +1,132 @@ | ||
<!doctype html> | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<title>{{title}}</title> | ||
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" /> | ||
<link href="https://unpkg.com/[email protected]/dist/bootstrap-table.min.css" rel="stylesheet" /> | ||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/extensions/sticky-header/bootstrap-table-sticky-header.css"> | ||
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css" rel="stylesheet"> | ||
<style> | ||
.text-toggle, .full-text { cursor: pointer; } | ||
th:nth-child(1), td:nth-child(1) { width: 5%; } | ||
th:nth-child(2), td:nth-child(2), | ||
th:nth-child(3), td:nth-child(3) { width: 30%; } | ||
th, td { | ||
overflow: hidden; | ||
text-overflow: ellipsis; | ||
} | ||
h2 { | ||
margin-top: 10px; | ||
} | ||
.copy-link-icon { | ||
font-size: 20px; | ||
margin-left: 10px; | ||
color: #8f8f97; | ||
cursor: pointer; | ||
} | ||
.copy-link-icon:hover { | ||
color: #282b2c; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<div class="container-fluid">{{table}}</div> | ||
<script src="https://cdn.jsdelivr.net/npm/jquery/dist/jquery.min.js"></script> | ||
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script> | ||
<script src="https://unpkg.com/[email protected]/dist/bootstrap-table.min.js"></script> | ||
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/extensions/sticky-header/bootstrap-table-sticky-header.min.js"></script> | ||
<script> | ||
$(window).on('load', function() { | ||
var hash = window.location.hash; | ||
if (hash) { | ||
setTimeout(function() { | ||
$('html, body').animate({ scrollTop: $(hash).offset().top }, 100); | ||
}, 100); | ||
<head> | ||
<meta charset="utf-8" /> | ||
<title>{{title}}</title> | ||
<link | ||
href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" | ||
rel="stylesheet" | ||
/> | ||
<link | ||
href="https://unpkg.com/[email protected]/dist/bootstrap-table.min.css" | ||
rel="stylesheet" | ||
/> | ||
<link | ||
rel="stylesheet" | ||
href="https://cdn.jsdelivr.net/npm/[email protected]/dist/extensions/sticky-header/bootstrap-table-sticky-header.css" | ||
/> | ||
<link | ||
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css" | ||
rel="stylesheet" | ||
/> | ||
<style> | ||
.text-toggle, | ||
.full-text { | ||
cursor: pointer; | ||
} | ||
}); | ||
</script> | ||
<script> | ||
function copyPermalink(anchorId) { | ||
const fullUrl = window.location.origin + window.location.pathname + anchorId; | ||
history.pushState(null, null, anchorId); | ||
navigator.clipboard.writeText(fullUrl) | ||
setTimeout(function() { | ||
$('html, body').animate({ scrollTop: $(anchorId).offset().top }, 100); | ||
}, 100); | ||
} | ||
</script> | ||
<script> | ||
$(document).ready(function() { | ||
$('table.table td').each(function() { | ||
var cell = $(this); | ||
if (cell.text().length > 100) { | ||
var originalText = cell.text(); | ||
var displayText = originalText.substring(0, 100) + '...'; | ||
cell.html('<span class="text-toggle">' + displayText + '</span><span class="full-text" style="display: none;">' + originalText + '</span>'); | ||
cell.append('<a href="#" class="toggle-link">Show More</a>'); | ||
} | ||
}); | ||
$('body').on('click', '.toggle-link', function(e) { | ||
e.preventDefault(); | ||
var link = $(this); | ||
var textSpan = link.siblings('.full-text'); | ||
var toggleSpan = link.siblings('.text-toggle'); | ||
if (textSpan.is(':visible')) { | ||
link.text('Show More'); | ||
textSpan.hide(); | ||
toggleSpan.show(); | ||
} else { | ||
link.text('Show Less'); | ||
textSpan.show(); | ||
toggleSpan.hide(); | ||
} | ||
}); | ||
}); | ||
</script> | ||
</body> | ||
th:nth-child(1), | ||
td:nth-child(1) { | ||
width: 5%; | ||
} | ||
th:nth-child(2), | ||
td:nth-child(2), | ||
th:nth-child(3), | ||
td:nth-child(3) { | ||
width: 30%; | ||
} | ||
th, | ||
td { | ||
overflow: hidden; | ||
text-overflow: ellipsis; | ||
} | ||
h2 { | ||
margin-top: 10px; | ||
} | ||
.copy-link-icon { | ||
font-size: 20px; | ||
margin-left: 10px; | ||
color: #8f8f97; | ||
cursor: pointer; | ||
} | ||
.copy-link-icon:hover { | ||
color: #282b2c; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<div class="container-fluid">{{table}}</div> | ||
<script src="https://cdn.jsdelivr.net/npm/jquery/dist/jquery.min.js"></script> | ||
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script> | ||
<script src="https://unpkg.com/[email protected]/dist/bootstrap-table.min.js"></script> | ||
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/extensions/sticky-header/bootstrap-table-sticky-header.min.js"></script> | ||
<script> | ||
$(window).on("load", function () { | ||
var hash = window.location.hash; | ||
if (hash) { | ||
setTimeout(function () { | ||
$("html, body").animate( | ||
{ scrollTop: $(hash).offset().top }, | ||
100 | ||
); | ||
}, 100); | ||
} | ||
}); | ||
</script> | ||
<script> | ||
$(document).ready(function () { | ||
scrollToHashLocation(); | ||
setupTextToggles(); | ||
setupEventHandlers(); | ||
}); | ||
|
||
function setupEventHandlers() { | ||
$(window).on("load", scrollToHashLocation); | ||
$("body").on("click", ".toggle-link", toggleText); | ||
} | ||
|
||
function scrollToHashLocation() { | ||
const hash = window.location.hash; | ||
if (hash) { | ||
setTimeout(() => { | ||
$("html, body").animate( | ||
{ scrollTop: $(hash).offset().top }, | ||
100 | ||
); | ||
}, 100); | ||
} | ||
} | ||
|
||
function copyPermalink(anchorId) { | ||
const fullUrl = `${window.location.origin}${window.location.pathname}${anchorId}`; | ||
history.pushState(null, null, anchorId); | ||
navigator.clipboard.writeText(fullUrl); | ||
scrollToHashLocation(); | ||
} | ||
|
||
function toggleText(e) { | ||
e.preventDefault(); | ||
const link = $(this), | ||
textSpan = link.siblings(".full-text"), | ||
toggleSpan = link.siblings(".text-toggle"); | ||
const visible = textSpan.is(":visible"); | ||
link.text(visible ? "Show More" : "Show Less"); | ||
textSpan.toggle(); | ||
toggleSpan.toggle(); | ||
} | ||
|
||
function setupTextToggles() { | ||
$("table.table td").each(function () { | ||
var cell = $(this); | ||
if (cell.text().length > 100) { | ||
var originalText = cell.text(); | ||
var displayText = | ||
originalText.substring(0, 100) + "..."; | ||
cell.html( | ||
`<span class="text-toggle">${displayText}</span><span class="full-text" style="display: none;">${originalText}</span><a href="#" class="toggle-link">Show More</a>` | ||
); | ||
} | ||
}); | ||
} | ||
</script> | ||
</body> | ||
</html> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.