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

Less smart Drupal core version detection #46

Merged
merged 3 commits into from
May 20, 2024
Merged

Less smart Drupal core version detection #46

merged 3 commits into from
May 20, 2024

Conversation

weitzman
Copy link
Collaborator

@weitzman weitzman commented May 20, 2024

Issue discussion at #38

This is my proposal for version detection. Default to 10 (until 11 is released), and ask user to override via ddev config as needed. No more looking at DDEV_PROJECT_TYPE.

I'm unsure how best to override the env variable that this project's config.contrib.yaml. Supplies. Can user do that in their project's config.yaml, or do they need to create a config.zz.yaml?

tests/test.bats Outdated Show resolved Hide resolved
Co-authored-by: Randy Fay <[email protected]>
@rfay
Copy link
Member

rfay commented May 20, 2024

I'm unsure how best to override the env variable that this project's config.contrib.yaml. Supplies. Can user do that in their project's config.yaml, or do they need to create a config.zz.yaml?

Either

  • ddev config --web-environment-add=<SOMEENV>=<someval> is one way (same as editing web_environment in config.yaml or
  • web_environment in a config.*.yaml

both seem fine to me.

@weitzman weitzman merged commit c361f7f into main May 20, 2024
2 checks passed
@weitzman weitzman deleted the target-core branch May 20, 2024 16:55
@kekkis
Copy link
Contributor

kekkis commented May 20, 2024

The _TARGET_CORE environment variable is not used anywhere though. The current environment variable name is DRUPAL_CORE. See https://git.drupalcode.org/project/gitlab_templates/-/raw/default-ref/scripts/expand_composer_json.php for reference; that is the script downloaded by the expand-composer-json command (the very script changed in this PR).

Snippet from said script at its current version:

$core_version = str_replace(['^', '~'], ['', ''], getenv('DRUPAL_CORE'));

@weitzman
Copy link
Collaborator Author

Woops, so this detection never worked right. Gosh, I wish people would report bugs more often.

I'll change the var name now.

@weitzman
Copy link
Collaborator Author

Fixed in #47

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants