Skip to content

Print annotations in annotations check and ignore ubuntu-latest warnings#84

Merged
glx22 merged 2 commits intomainfrom
annot-exclude-latest
Dec 3, 2024
Merged

Print annotations in annotations check and ignore ubuntu-latest warnings#84
glx22 merged 2 commits intomainfrom
annot-exclude-latest

Conversation

@LordAro
Copy link
Copy Markdown
Member

@LordAro LordAro commented Dec 3, 2024

CI is currently failing due to the annotation:

"ubuntu-latest pipelines will use ubuntu-24.04 soon. For more details, see https://github.com/actions/runner-images/issues/10636"

Apart from being irritating, this was very difficult to discover as I had to delve into the API results to get any output we all missed the error that's printed in several places. This has been an issue in the past too - discovering where a single warning is coming from in the sea of CI results can be difficult, and clicking the "Check annotations" job that has the suspicious red cross gives nothing useful except "1 annotation" or whatever.

So to start with, I've added a lookup of the annotations (if there are any) and that will be printed to the job output.

Then I added a condition to ignore annotations that start with "ubuntu-latest". Probably a bit hacky. I went with this rather than the more explicit method of writing the annotation out in full as it seems likely that they'll use this format again in future. Any other ideas, I'm all ears.

Completely untested, I've just been looking at the API documentation. No idea how to test it beyond running the CI.

@LordAro LordAro requested a review from TrueBrain December 3, 2024 14:23
@LordAro LordAro force-pushed the annot-exclude-latest branch from 0406390 to 697f4a7 Compare December 3, 2024 14:34

for (const annotation of annotations.data) {
core.info(`${annotation.path}:${annotation.start_line} - ${annotation.message}`)
if (!annotation.message.startsWith("ubuntu-latest")) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same happens from time to time for the other images. So maybe look for the other parts that are more generic.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not entirely convinced GH is ever going to use this format again, and we only use windows-latest & ubuntu-latest as far as I can see (and I don't think windows-latest is going to change in a meaningful way anytime soon). But I've updated it to be generic anyway. Unsure if better.

@LordAro LordAro force-pushed the annot-exclude-latest branch 2 times, most recently from 709bedf to c33048a Compare December 3, 2024 15:06
@glx22
Copy link
Copy Markdown
Contributor

glx22 commented Dec 3, 2024

I like the idea, my main concern is about how to be sure about github messages formatting consistency.

@LordAro LordAro force-pushed the annot-exclude-latest branch from c33048a to 0525d1d Compare December 3, 2024 17:28
@LordAro LordAro force-pushed the annot-exclude-latest branch from 0525d1d to a615d5b Compare December 3, 2024 17:30
Copy link
Copy Markdown
Contributor

@glx22 glx22 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, but hard to test without it being force merged first.

@glx22 glx22 merged commit 8590552 into main Dec 3, 2024
@glx22 glx22 deleted the annot-exclude-latest branch December 3, 2024 17:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants