-
Notifications
You must be signed in to change notification settings - Fork 798
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
wpcomsh: Fix generate POT scanned file paths #38153
Conversation
Thank you for your PR! When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:
This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖 The e2e test report can be found here. Please note that it can take a few minutes after the e2e tests checks are complete for the report to be available. Once your PR is ready for review, check one last time that all required checks appearing at the bottom of this PR are passing or skipped. Wpcomsh plugin:
If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack. |
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.
One suggestion inline to improve the find
command. Otherwise this seems to make sense.
Too bad we can't have this work more like wporg plugins though, where GlotPress does the extracting and the language files are downloaded by WordPress separately instead of having to be committed inside the monorepo.
@@ -14,6 +14,8 @@ find . -name '*.php' -and ! -path './build/*' -and ! -path './custom-colors/*' \ | |||
-or -path './vendor/automattic/jetpack-config/*' \ | |||
-or -path './vendor/automattic/jetpack-post-list/*' \ | |||
\) \ | |||
-and ! -path './vendor/*/vendor/*' \ | |||
-and ! -path './vendor/*/wordpress/*' \ |
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.
While all this seems to work, it spits out a bunch of warnings when I try it:
find: warning: you have specified the global option -maxdepth after the argument -name, but global options are not positional, i.e., -maxdepth affects tests specified before it as well as those specified after it. Please specify global options before other arguments.
find: File system loop detected; ‘./vendor/automattic/jetpack-status/vendor/automattic/jetpack-plans/vendor/automattic/jetpack-status’ is part of the same file system loop as ‘./vendor/automattic/jetpack-status’.
find: File system loop detected; ‘./vendor/automattic/jetpack-status/vendor/automattic/jetpack-redirect/vendor/automattic/jetpack-status’ is part of the same file system loop as ‘./vendor/automattic/jetpack-status’.
find: File system loop detected; ‘./vendor/automattic/jetpack-status/vendor/automattic/jetpack-connection/vendor/automattic/jetpack-status’ is part of the same file system loop as ‘./vendor/automattic/jetpack-status’.
find: File system loop detected; ‘./vendor/automattic/jetpack-config/vendor/automattic/jetpack-search/vendor/automattic/jetpack-config’ is part of the same file system loop as ‘./vendor/automattic/jetpack-config’.
find: File system loop detected; ‘./vendor/automattic/jetpack-config/vendor/automattic/jetpack-sync/vendor/automattic/jetpack-config’ is part of the same file system loop as ‘./vendor/automattic/jetpack-config’.
find: File system loop detected; ‘./vendor/automattic/jetpack-config/vendor/automattic/jetpack-my-jetpack/vendor/automattic/jetpack-config’ is part of the same file system loop as ‘./vendor/automattic/jetpack-config’.
find: File system loop detected; ‘./vendor/automattic/jetpack-config/vendor/automattic/jetpack-wordads/vendor/automattic/jetpack-config’ is part of the same file system loop as ‘./vendor/automattic/jetpack-config’.
find: File system loop detected; ‘./vendor/automattic/jetpack-config/vendor/automattic/jetpack-publicize/vendor/automattic/jetpack-config’ is part of the same file system loop as ‘./vendor/automattic/jetpack-config’.
find: File system loop detected; ‘./vendor/automattic/jetpack-sync/vendor/automattic/jetpack-config/vendor/automattic/jetpack-sync’ is part of the same file system loop as ‘./vendor/automattic/jetpack-sync’.
find: File system loop detected; ‘./vendor/automattic/jetpack-sync/vendor/automattic/jetpack-search/vendor/automattic/jetpack-sync’ is part of the same file system loop as ‘./vendor/automattic/jetpack-sync’.
find: File system loop detected; ‘./vendor/automattic/jetpack-sync/vendor/automattic/jetpack-my-jetpack/vendor/automattic/jetpack-sync’ is part of the same file system loop as ‘./vendor/automattic/jetpack-sync’.
find: File system loop detected; ‘./vendor/automattic/jetpack-sync/vendor/automattic/jetpack-connection/vendor/automattic/jetpack-sync’ is part of the same file system loop as ‘./vendor/automattic/jetpack-sync’.
find: File system loop detected; ‘./vendor/automattic/jetpack-plans/vendor/automattic/jetpack-status/vendor/automattic/jetpack-plans’ is part of the same file system loop as ‘./vendor/automattic/jetpack-plans’.
find: File system loop detected; ‘./vendor/automattic/jetpack-redirect/vendor/automattic/jetpack-status/vendor/automattic/jetpack-redirect’ is part of the same file system loop as ‘./vendor/automattic/jetpack-redirect’.
find: File system loop detected; ‘./vendor/automattic/jetpack-connection/vendor/automattic/jetpack-status/vendor/automattic/jetpack-connection’ is part of the same file system loop as ‘./vendor/automattic/jetpack-connection’.
find: File system loop detected; ‘./vendor/automattic/jetpack-connection/vendor/automattic/jetpack-sync/vendor/automattic/jetpack-connection’ is part of the same file system loop as ‘./vendor/automattic/jetpack-connection’.
find: File system loop detected; ‘./vendor/automattic/jetpack-connection/vendor/automattic/jetpack-licensing/vendor/automattic/jetpack-connection’ is part of the same file system loop as ‘./vendor/automattic/jetpack-connection’.
I'd recommend using -prune
to skip processing of the nested vendor
and wordpress
(and also node_modules
and jetpack_vendor
), perhaps something like this
find -L . \
\( \
-path './vendor/*/vendor' \
-or -path './vendor/*/wordpress' \
-or -path './vendor/*/node_modules' \
-or -path './vendor/*/jetpack_vendor' \
\) \
-prune \
-or \
-name '*.php' -and ! -path './build/*' -and ! -path './custom-colors/*' \
-and \( \
! -path './vendor/*' \
-or -path './vendor/automattic/jetpack-mu-wpcom/*' \
-or -path './vendor/automattic/at-pressable-podcasting/*' \
-or -path './vendor/automattic/custom-fonts-typekit/*' \
-or -path './vendor/automattic/custom-fonts/*' \
-or -path './vendor/automattic/jetpack-assets/*' \
-or -path './vendor/automattic/jetpack-config/*' \
-or -path './vendor/automattic/jetpack-post-list/*' \
\) \
-print
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.
Thanks for the suggestion! I've updated the PR.
Although I wasn't seeing the warnings locally, prior to adding -maxdepth
in my approach, the find
command was taking long time to execute, which I assume was indeed a file system loop.
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.
Seems reasonable to me.
Fixes p1719903725313999-slack-C02AED43D
Proposed changes:
generate-pot.sh
to follow symlinks so that it scans the files invendor/
that are symlinked to the packages in the monorepo.vendor
andwordpress
directories to prevent unwanted files from scanning.Other information:
Jetpack product discussion
Does this pull request change what data or activity we track or use?
Testing instructions:
projects/plugins/wpcomsh/bin/i18n/generate-pot.sh
.projects/plugins/wpcomsh/languages/wpcomsh.pot
and confirm the newly added strings are all expected to be there.make i18n
inprojects/plugins/wpcomsh
to confirm it runs as expected.