-
Notifications
You must be signed in to change notification settings - Fork 63
Regenerate POT files if Vue files have been staged #1101
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't love this solution because it forces you to commit all changes to the pot file regardless of whether you're commit all changes to all vue files that are changed.
For example, if you make changes to a.vue
and b.vue
but only stage b.vue
, the line updates for a.vue
will also be committed when you commit b.vue
.
An alternative to this is to make this check a pre-push
check to fail before running the unit tests if the POT file is out of date.
In any case, it's a pre-existing problem with the en.json
file and theoretically the POT file having incorrect line numbers doesn't break the app's functionality so wouldn't inadvertently render an otherwise valid commit invalid (broken).
In any case, we're not merging PRs till all reasonable checks pass so at the time of merge all differences between the POT and the Vue code will be resolved. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
I just realised that this will still allow the POT check CI to fail. Need a more resilient approach here. |
@dhruvkb Is there a problem with just always running the POT generation in pre-commit regardless of the files changed? |
The issue is that POT generation will include the changed but unstaged files unless those are staged before the commit. |
@dhruvkb It did that for the original solution anyway, that's what my comment was about above. We could move it to pre-push and encourage it to be a separate commit if that would make it clearer. What you said about the PR getting squashed before merge making the commit-level discrepancies irrelevant makes sense to me. |
This is not a good solution and still leaves room for CI failures. |
Fixes
Description
Since the PO files contain references to Vue components, this PR updates the code that generates them to run when Vue files are in the Git diff.
Testing Instructions
Checklist
Update index.md
).main
) or a parent feature branch.Developer Certificate of Origin
Developer Certificate of Origin