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

feat: add a11y-alt-text bot #989

Merged
merged 13 commits into from
Oct 30, 2023

Conversation

DerTimonius
Copy link
Contributor

PR Checklist

Overview

This PR adds a new bot to check for alt text in issue, PR or discussion comments.

With the .yml file, I followed the suggestion in the official repo and adapted the used version to the latest version.

@codecov
Copy link

codecov bot commented Oct 27, 2023

Codecov Report

Merging #989 (50fe1de) into main (5201497) will increase coverage by 0.04%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main     #989      +/-   ##
==========================================
+ Coverage   93.57%   93.61%   +0.04%     
==========================================
  Files          92       92              
  Lines        4921     4952      +31     
  Branches      413      413              
==========================================
+ Hits         4605     4636      +31     
  Misses        315      315              
  Partials        1        1              
Flag Coverage Δ
create 71.18% <100.00%> (+0.18%) ⬆️
initialize 38.38% <21.21%> (-0.11%) ⬇️
migrate 70.06% <100.00%> (+0.19%) ⬆️
unit 68.77% <100.00%> (+0.19%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
...s/writing/creation/dotGitHub/createWorkflowFile.ts 100.00% <100.00%> (ø)
...teps/writing/creation/dotGitHub/createWorkflows.ts 99.14% <100.00%> (+0.09%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Owner

@JoshuaKGoldberg JoshuaKGoldberg left a comment

Choose a reason for hiding this comment

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

Thanks for sending this in @DerTimonius! Quoting #825 (comment):

I'll want to see examples of the bot in another repository that you've set up with the latest version of the bot. I'd suggest using this template to make a new repository.

In other words: could you please show this working in a repo you've created? It'll help reviewing to have us both play with it.

Also, note that you've got failures in CI. See the .github/DEVELOPMENT.md file for how to resolve them. Or let me know if that's unclear. Cheers!

@JoshuaKGoldberg JoshuaKGoldberg added the status: waiting for author Needs an action taken by the original poster label Oct 28, 2023
@DerTimonius
Copy link
Contributor Author

DerTimonius commented Oct 28, 2023

Sure, I added it to a repo of mine and opened an issue with images with missing alt texts: DerTimonius/til-blog#7

Edit: currently working on fixing the failing test

@DerTimonius DerTimonius changed the title a11y: add alt bot add: a11y-alt-text bot Oct 28, 2023
@DerTimonius DerTimonius changed the title add: a11y-alt-text bot feat: add a11y-alt-text bot Oct 28, 2023
@DerTimonius
Copy link
Contributor Author

Tests are fixed now 🙂

Copy link
Owner

@JoshuaKGoldberg JoshuaKGoldberg left a comment

Choose a reason for hiding this comment

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

Looks great, thanks!

Left a few stylistic cleanups as comments - they're super minimal and not big deals at all. I can make these changes and fix up the main stuff. Cheers!

Goth girl shouting furiously in triumph

.github/workflows/a11y-add-alt-bot.yml Outdated Show resolved Hide resolved
.github/workflows/a11y-add-alt-bot.yml Outdated Show resolved Hide resolved
src/steps/writing/creation/rootFiles.ts Outdated Show resolved Hide resolved
.github/workflows/a11y-add-alt-bot.yml Outdated Show resolved Hide resolved
.github/workflows/a11y-add-alt-bot.yml Outdated Show resolved Hide resolved
@JoshuaKGoldberg JoshuaKGoldberg removed the status: waiting for author Needs an action taken by the original poster label Oct 28, 2023
Copy link
Owner

@JoshuaKGoldberg JoshuaKGoldberg left a comment

Choose a reason for hiding this comment

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

Oh right almost forgot - this'll need to be added to the workflows.ts file and its corresponding test. Otherwise this won't be added to created/templated repos.

@JoshuaKGoldberg JoshuaKGoldberg added the status: waiting for author Needs an action taken by the original poster label Oct 28, 2023
@DerTimonius
Copy link
Contributor Author

@JoshuaKGoldberg I added the bot to the created files (good idea, did not think about that) - had to change a few types along the way. Also I added the .yml file to the filesExpectedToBeChanged Set in the migrate-test-e2e.js file - I wasn't sure if I should change the formatting of the original file or if I should add it to the set instead and went with the latter. I hope that's okay, if not I'll change it 🙂

@JoshuaKGoldberg
Copy link
Owner

Also I added the .yml file to the filesExpectedToBeChanged Set in the migrate-test-e2e.js file - I wasn't sure if I should change the formatting of the original file or if I should add it to the set instead and went with the latter. I hope that's okay, if not I'll change it 🙂

Mmhh yeah it's the other way around: the files in the repo should match the templates. I'd like to whittle that list down of "these are intentionally different" to zero over time. Change request: have the .yml file match the template. Thanks!

@DerTimonius
Copy link
Contributor Author

@JoshuaKGoldberg The latest change also changes the location of the if statement in the .yml file. Again, I'm a bit unsure wether the if should be in the steps as it is now or in the same scope as runs-on and steps? I already fixed this locally, but I wanted to wait for your feedback on this one

@JoshuaKGoldberg JoshuaKGoldberg removed the status: waiting for author Needs an action taken by the original poster label Oct 30, 2023
Copy link
Owner

@JoshuaKGoldberg JoshuaKGoldberg left a comment

Choose a reason for hiding this comment

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

💯. I suspect the if isn't necessary, but that feels like a suggestion to make on the accessibility-alt-text-bot repo. I can file that over there #997.

Otherwise, yeah, this is looking wonderful. Thanks! 🚀

@JoshuaKGoldberg JoshuaKGoldberg merged commit 8050c83 into JoshuaKGoldberg:main Oct 30, 2023
16 checks passed
@github-actions
Copy link

🎉 This is included in version v1.41.0 🎉

The release is available on:

Cheers! 📦🚀

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.

🚀 Feature: Add accessibility-alt-text-bot GitHub Actions workflow
2 participants