Skip to content

Conversation

@matthiaz
Copy link
Contributor

@matthiaz matthiaz commented Feb 12, 2025

Closes #21
Which allows onProduction to correctly identify the production environment, without having to be named 'master'

This issue is fairly old, and an attempt was made to fix this in #22
However, backwards compatibility was not maintained in there.

This PR tries to address that backwards compatibility, so this should work for old and new environments.

@matthiaz matthiaz force-pushed the mr/matthias/fix-environment-type-with-backwards-compatibility-in-mind branch 4 times, most recently from 632315e to 5beb7fc Compare February 12, 2025 09:38
@matthiaz matthiaz force-pushed the mr/matthias/fix-environment-type-with-backwards-compatibility-in-mind branch from 5beb7fc to 917621a Compare February 12, 2025 09:47
@matthiaz matthiaz force-pushed the mr/matthias/fix-environment-type-with-backwards-compatibility-in-mind branch from 917621a to 26fe9f4 Compare February 12, 2025 09:52
return $this->getValue('ENVIRONMENT_TYPE') == 'production';
} else {
// legacy way of checking production type
$prodBranch = $this->onDedicated() ? 'production' : 'master';
Copy link

Choose a reason for hiding this comment

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

master ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

well yeah, that's the backwards compatibility. Ideally we won't ever get into this else statement. But if we do, the functionality needs to be the same.

@gmoigneu gmoigneu merged commit cab2b6c into platformsh:master Feb 25, 2025
5 checks passed
This was referenced Feb 25, 2025
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.

Config::onProduction fails if using branch name "main"

3 participants