Validate the request signature screenshot in pull requests
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 55/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- github-actions, javascript
- Ambito
- ci-cd, devops, testing-qa
Direzione di ricerca
Inizia con il comando di generazione dello screenshot di #8090, con il file img/screenshot/request-signature.png committato e con gli esempi referenziati di checker.mjs e documentation-screenshots.yml. Costruisci la validazione di GitHub Actions attorno al confronto indicato, alla tolleranza, agli artefatti diff e al comportamento dei commenti nella pull request; il lavoro è completo quando tutti i criteri di accettazione sono soddisfatti senza eseguire automaticamente il commit dello screenshot.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
The screenshot generation added in #8090 should also be validated automatically in pull requests.
The goal is to detect when changes to the LibreSign interface make img/screenshot/request-signature.png outdated.
This issue depends on #8090.
What should be done
Add a GitHub Actions workflow that:
- runs the screenshot generation command from #8090;
- compares the generated image with the committed
img/screenshot/request-signature.png; - uses
pixelmatchor an equivalent small visual comparison library; - ignores insignificant rendering differences using a reasonable tolerance;
- succeeds when the screenshots match within the allowed tolerance;
- fails when a relevant visual difference is detected.
When the comparison fails, the workflow should:
- report the number or percentage of different pixels;
- generate a visual diff;
- upload the generated screenshot and diff as workflow artifacts;
- add or update a comment in the pull request.
Reference implementation
A similar implementation can be used as reference from LSTelegramNotify:
[comparePngBuffers()](https://github.com/LibreCodeCoop/LSTelegramNotify/blob/c2f68cbdbe6318d134a5f2e79ccf27cded9106c0/scripts/screenshots/checker.mjs#L8-L47)shows howpixelmatchcan compare two PNG buffers and report the number and percentage of different pixels;[assertScreenshotsUpToDate()](https://github.com/LibreCodeCoop/LSTelegramNotify/blob/c2f68cbdbe6318d134a5f2e79ccf27cded9106c0/scripts/screenshots/checker.mjs#L49-L124)shows how a failed comparison can generate a visual diff;[documentation-screenshots.yml](https://github.com/LibreCodeCoop/LSTelegramNotify/blob/c2f68cbdbe6318d134a5f2e79ccf27cded9106c0/.github/workflows/documentation-screenshots.yml)shows how screenshot validation and diff artifacts can be handled in GitHub Actions.
The LibreSign implementation does not need to copy this structure exactly.
Pull request comment
When a relevant difference is found, the workflow should leave a short comment explaining that the request signature screenshot may be outdated.
The comment should include:
- the detected difference;
- a note telling the contributor to run the screenshot generation command from #8090 if the visual change is expected;
- a reference to the workflow artifacts with the generated screenshot and visual diff.
The workflow should avoid creating duplicate comments. If a screenshot validation comment already exists, update it instead.
A hidden marker can be used to identify the comment, for example:
<!-- libresign-request-signature-screenshot-check -->
No comment is needed when the screenshot matches.
The workflow must not automatically commit the generated screenshot. Updating img/screenshot/request-signature.png should remain an explicit change made after reviewing the detected visual difference.
Acceptance criteria
- The screenshot generated by #8090 is compared with the committed
img/screenshot/request-signature.png. -
pixelmatchor an equivalent approach is used for visual comparison. - A documented tolerance prevents failures caused only by insignificant rendering differences.
- The workflow succeeds when the images match within the allowed tolerance.
- The workflow fails when a relevant visual difference is detected.
- The comparison reports the number or percentage of different pixels.
- A visual diff is generated when the comparison fails.
- The generated screenshot and visual diff are uploaded as GitHub Actions artifacts.
- A pull request comment explains when the screenshot may need to be updated.
- Repeated runs update the existing validation comment instead of creating duplicate comments.
- The workflow does not automatically commit screenshot changes.
Additional context
- If you have questions, feel free to ask in this issue.
- Give a ⭐️ star to this repository if you find LibreSign useful and would like to support the project.
- You can also join our community: https://t.me/LibreSign
- Lingua principale
- PHP
- Stelle
- 818
- Fork
- 146
- Merge medio
- 7h 38m
- PR unite (30g)
- 490
Preparare l'ambiente
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di LibreSign/libresign
-
backend enhancement good first issue php
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
LibreSign/libresign#8713 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
LibreSign/libresign#8284 · 5 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
backend good first issue php
Difficoltà 3/5 1-2 giorni Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
javascript
Difficoltà 5/5 Più di una settimana Idoneità per principianti 38/100
I maintainer di solito rispondono entro 1 giorno
-
good first issue javascript
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
LibreSign/libresign#8727 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di LibreSign/libresign
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
-
domain/crm-after-sales Platform(Default) priority/high
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
kind/bug status/to verify
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
PHP-CS-Fixer/PHP-CS-Fixer#9867 ·
I maintainer di solito rispondono entro 1 giorno
-
sync-en
Difficoltà 1/5 1-3 ore Idoneità per principianti 86/100
I maintainer di solito rispondono entro 2 giorni
-
sync-en
Difficoltà 1/5 1-3 ore Idoneità per principianti 88/100
I maintainer di solito rispondono entro 2 giorni