Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/trunk' into try/one-wordpress-to…
Browse files Browse the repository at this point in the history
…-rule-them-all
  • Loading branch information
kraftbj committed Jan 27, 2025
2 parents 6b12c53 + dd5f0a8 commit c845cf9
Show file tree
Hide file tree
Showing 340 changed files with 1,923 additions and 1,481 deletions.
1 change: 0 additions & 1 deletion .github/files/coverage-munger/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"private": true,
"name": "jetpack-gh-config-munger",
"devDependencies": {
"istanbul-merge": "^2.0.0",
"nyc": "^17.1.0"
Expand Down
4 changes: 2 additions & 2 deletions .github/files/coverage-munger/process-coverage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,14 @@ fi
TMP=$( find "$PWD/coverage" -name '*.json' )
if [[ -n "$TMP" ]]; then
echo "::group::Combining JS coverage"
pnpm --filter=jetpack-gh-config-munger exec istanbul-merge --out "$PWD"/artifacts/js-combined.json $TMP
pnpm --filter=./.github/files/coverage-munger/ exec istanbul-merge --out "$PWD"/artifacts/js-combined.json $TMP
perl -i -pwe 'BEGIN { $prefix = shift; $prefix=~s!/*$!/!; $re = qr/\Q$prefix\E/; } s!"$re!"!g' "$GITHUB_WORKSPACE" artifacts/js-combined.json
echo '::endgroup::'

echo "::group::Creating JS coverage summary"
mkdir "$TMP_DIR/js"
cp artifacts/js-combined.json "$TMP_DIR/js"
pnpm --filter=jetpack-gh-config-munger exec nyc report --no-exclude-after-remap --report-dir="$TMP_DIR" --temp-dir="$TMP_DIR/js" --reporter=json-summary
pnpm --filter=./.github/files/coverage-munger/ exec nyc report --no-exclude-after-remap --report-dir="$TMP_DIR" --temp-dir="$TMP_DIR/js" --reporter=json-summary
jq -r 'to_entries[] | select( .key != "total" ) | [ .key, .value.lines.total, .value.lines.covered ] | @tsv' "$TMP_DIR/coverage-summary.json" > "$TMP_DIR/js-summary.tsv"
echo '::endgroup::'
else
Expand Down
17 changes: 17 additions & 0 deletions .github/files/lint-project-structure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -645,5 +645,22 @@ while IFS= read -r FILE; do
done < <( git grep -h --line-number --column -o '\(random\|unique-id\)\s*(' "$FILE" )
done < <( git -c core.quotepath=off grep -l '\(random\|unique-id\)\s*(' '*.sass' '*.scss' )

# - package.json name fields must be prefixed or already registered.
debug "Checking for bad package.json names"
while IFS=$'\t' read -r FILE NAME; do
LINE=$(grep --line-number --max-count=1 '^ "name":' "$FILE" || true)
if [[ -n "$LINE" ]]; then
LINE=",line=${LINE%%:*}"
fi

J=$( curl -sS "https://registry.npmjs.com/$( jq -rn --arg V "$NAME" '$V | @uri' )" )
if ! jq -e '.maintainers' <<<"$J" &>/dev/null; then
EXIT=1
echo "::error file=$FILE$LINE::Name $NAME is not published and not scoped. If it is not supposed to be published to npmjs, then if possible omit the \"name\" field entirely or otherwise rename it like \"@automattic/$NAME\" or \"_$NAME\" or manually publish a dummy version. If it will be published, rename it like \"@automattic/$NAME\" or manually publish a dummy version."
elif ! jq -e '.maintainers[] | select( .name == "matticbot" or .name == "npm" )' <<<"$J" &>/dev/null; then
EXIT=1
echo "::error file=$FILE$LINE::Name $NAME is not owned by us (\`matticbot\`) or the NPM security account (\`npm\`). If this is not supposed to be published to npmjs, then if possible omit the \"name\" field entirely or otherwise rename it like \"@automattic/$NAME\" or \"_$NAME\". If it will be published, either add \`matticbot\` as a maintainer if we can or you'll have to rename (e.g. like \"@automattic/$NAME\")."
fi
done < <( jq -r '.name // empty | select( startswith( "@automattic/" ) or startswith( "_" ) | not ) | [ input_filename, . ] | @tsv' $( git ls-files package.json '*/package.json' ) )

exit $EXIT
7 changes: 6 additions & 1 deletion .phan/stubs/wpcom-stubs.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* `bin/teamcity-builds/jetpack-stubs/stub-defs.php` and regenerate the stubs
* by triggering the Jetpack Staging → Update WPCOM Stubs job in TeamCity.
*
* Stubs automatically generated from WordPress.com commit c22dbf3bcf2334f7010cf491a7817654b95c54fe.
* Stubs automatically generated from WordPress.com commit 8455d799e19d81bab955e52ecf72bcda5d4e6e34.
*/

namespace {
Expand Down Expand Up @@ -260,6 +260,11 @@ class WPCOM_External_Connections
static function init()
{
}
/**
* @param string $type
* @param int|false $blog_id
* @return array
*/
public function get_external_services_list($type = \false, $blog_id = \false)
{
}
Expand Down
Loading

0 comments on commit c845cf9

Please sign in to comment.