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

Updating template/composer.json to use Drupal packagist constraints. #762

Merged
merged 1 commit into from
Dec 16, 2016

Conversation

grasmash
Copy link
Contributor

@grasmash grasmash commented Dec 6, 2016

No description provided.

@grasmash grasmash added in progress Enhancement A feature or feature request labels Dec 6, 2016
@grasmash
Copy link
Contributor Author

grasmash commented Dec 6, 2016

Todo:

  • Integrate script in update hook
  • Resolve drupal security advisory conflict (upstream in Lightning)

@grasmash grasmash force-pushed the issue-759-lightning-packagist branch from e8f6d95 to acc664d Compare December 7, 2016 17:25
// 8.1.0-alpha1 > 1.0.0-alpha1
// 8.1.0-beta12 > 1.0.0-beta12
// 8.12.0-rc22 > 12.0.0-rc22
if (preg_match('/^([\^~])?8(\.)?(\d+)?(\.\d+)?(-(alpha|beta|rc)\d+)?(\.\*)?(@(dev|alpha|beta|rc))?/', $version_constraint, $matches)) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to also cover refs and "dev-" prefixes.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


// dev-master => master-dev
// dev-something#123abc => something-dev#123abc
if (preg_match('/^dev-([A-Za-z0-9-]+)(#[0-9a-f]+)?/', $version_constraint, $matches)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't account for the possibility of underscores in the branch name.

function convert_version_constraint($version_constraint) {

// 8.* => *
if (preg_match('/8\.\*$/', $version_constraint)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's no anchor at the beginning, so won't this also match something like 1.8.*?

@balsama
Copy link
Contributor

balsama commented Dec 12, 2016

We ended up tweaking the output for branches a little bit to:

  • Account for the -dev coming at the end, e.g: "drupal/google_analytics": "8.2.x-dev"
  • Ultimately convert all branches to {#}.x-dev as that seems to be the only documented format for branches on D.O packagist

See here: https://github.com/acquia/lightning/blob/8.x-1.x/src/UpgradeBuild.php

@grasmash grasmash force-pushed the issue-759-lightning-packagist branch from 1f604de to 677f305 Compare December 16, 2016 00:53
@grasmash grasmash force-pushed the issue-759-lightning-packagist branch from 677f305 to 11f7737 Compare December 16, 2016 00:54
@grasmash grasmash merged commit 4248ddf into acquia:8.x Dec 16, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement A feature or feature request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants