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

renovate: Fix warnings from weird wpcomsh deps #37885

Merged
merged 3 commits into from
Jun 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions .github/renovate.json5
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,13 @@
// Monorepo packages are excluded in renovate-config.js, where we can read
// the list of them in code.

// Disable the packagist 'wordpress/classic-editor-plugin'. It's not in packagist, and we have a customManager for it below.
{
matchDatasources: [ 'packagist' ],
matchDepNames: [ 'wordpress/classic-editor-plugin' ],
enabled: false,
},

// Widen PHP dev deps to maintain support for old PHP versions we still support.
// When we drop an old PHP version we'll manually go through and narrow any ranges.
// (non-dev deps are handled in renovate-config.js where we can read the correct value for `constraints.php`)
Expand Down Expand Up @@ -106,7 +113,35 @@
depNameTemplate: 'renovate',
packageNameTemplate: 'ghcr.io/renovatebot/renovate',
},

// wpcomsh's wordpress/classic-editor-plugin fake-package.
{
customType: 'regex',
fileMatch: [ '^projects/plugins/wpcomsh/composer\\.json$' ],
matchStrings: [
// Alas the only option is regexing to match against the JSON. Four patterns for the four different places the version number appears.
// .require:
'"wordpress/classic-editor-plugin": "(?<currentValue>[0-9.]+)",',
// .repositories[].package.version
'"name": "wordpress/classic-editor-plugin",\\s+"version": "(?<currentValue>[0-9.]+)",',
// .repositories[].package.dist.url
'"url": "https://downloads\\.wordpress\\.org/plugin/classic-editor\\.(?<currentValue>[0-9.]+)\\.zip",',
// .repositories[].package.source.reference
'"url": "https://plugins\\.svn\\.wordpress\\.org/classic-editor/",\\s+"type": "svn",\\s+"reference": "tags/(?<currentValue>[0-9.]+)/"',
],
depNameTemplate: 'wordpress/classic-editor-plugin',
packageNameTemplate: 'classic-editor',
datasourceTemplate: 'custom.wordpress-plugin',
},
],
customDatasources: {
'wordpress-plugin': {
defaultRegistryUrlTemplate: 'https://api.wordpress.org/plugins/info/1.0/{{packageName}}.json',
transformTemplates: [
'{ "releases": $each( versions, function($v, $k) { $match( $k, /^[0-9.]+$/ ) ? { "version": $k } } ) }',
],
},
},

lockFileMaintenance: {
enabled: true,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Significance: patch
Type: added
Comment: Add names in composer.json `repositories` to make Renovate happy. No change to functionality.


5 changes: 5 additions & 0 deletions projects/plugins/wpcomsh/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,26 +73,31 @@
}
},
{
"name": "automattic/custom-fonts",
"type": "vcs",
"no-api": true,
"url": "https://github.com/Automattic/custom-fonts.git"
},
{
"name": "automattic/custom-fonts-typekit",
"type": "vcs",
"no-api": true,
"url": "https://github.com/Automattic/custom-fonts-typekit.git"
},
{
"name": "automattic/at-pressable-podcasting",
"type": "vcs",
"no-api": true,
"url": "https://github.com/automattic/at-pressable-podcasting.git"
},
{
"name": "automattic/text-media-widget-styles",
"type": "vcs",
"no-api": true,
"url": "https://github.com/Automattic/text-media-widget-styles.git"
},
{
"name": "automattic/wc-calypso-bridge",
"type": "vcs",
"no-api": true,
"url": "https://github.com/Automattic/wc-calypso-bridge.git"
Expand Down
2 changes: 1 addition & 1 deletion projects/plugins/wpcomsh/composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading