Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve final backporting result reports #145

Open
lampajr opened this issue Oct 28, 2024 · 1 comment
Open

Improve final backporting result reports #145

lampajr opened this issue Oct 28, 2024 · 1 comment
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@lampajr
Copy link
Member

lampajr commented Oct 28, 2024

Is your feature request related to a problem? Please describe.
Right now if something went wrong, we list all failures that occurred without linking it to the specific target branch to which it is associated with. This could be annoying when there are many issues or long errors.

Describe the solution you'd like
As final step, returns a <target-branch, result> report such that it clearly states which backport failed and which did not.

For instance, something in tabular format:

Target Branch Result Error
develop OK -
prod KO error: ....

Describe alternatives you've considered
n/a

Additional context
This could also be added in the failure comment added in the original pull request

@lampajr lampajr added the enhancement New feature or request label Oct 28, 2024
@lampajr
Copy link
Member Author

lampajr commented Oct 28, 2024

It should be probably enough to keep track of the target-branch associated to the occurred failure here

const failures: string[] = [];
// we need sequential backporting as they will operate on the same folder
// avoid cloning the same repo multiple times
for(const pr of backportPRs) {
try {
await this.executeBackport(configs, pr, {
gitClientType: gitClientType,
gitClientApi: gitApi,
gitCli: git,
});
} catch(error) {
this.logger.error(`Something went wrong backporting to ${pr.base}: ${error}`);
if (!configs.dryRun && configs.errorNotification.enabled && configs.errorNotification.message.length > 0) {
// notify the failure as comment in the original pull request
let comment = injectError(configs.errorNotification.message, error as string);
comment = injectTargetBranch(comment, pr.base);
await gitApi.createPullRequestComment(configs.originalPullRequest.url, comment);
}
failures.push(error as string);
}
}

@lampajr lampajr added the good first issue Good for newcomers label Oct 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant