acquia / drupal-environment-detector

Provides common methods for detecting the current Acquia environment
GNU General Public License v2.0
10 stars 12 forks source link

Use ORCA 3 #14

Closed danepowell closed 3 years ago

danepowell commented 3 years ago

@TravisCarden I need your help on this. The problem is that other Acquia packages require a stable version of the SUT, but ORCA installs a development version of the SUT for tests, so Composer can't resolve the dependency.

In this case, BLT requires acquia/drupal-environment-detector ^1.2.1, but since acquia/drupal-environment-detector is the SUT it's installed as dev-master in the fixture and Composer cannot resolve the dependency. See the failing tests.

I don't know how to work around this other than... I don't know, ORCA adding a version alias maybe? (e.g. require acquia/drupal-environment-detector:dev-master as 1.2.1)

danepowell commented 3 years ago

@TravisCarden I still need your help to unblock this, I think it requires a change in how ORCA creates the fixture.

TravisCarden commented 3 years ago

@danepowell, I think the "correct" way to solve this problem is with a branch alias something like the below in your own composer.json. It's a standard feature of Composer that has real meaning to the dependency ecosystem and is therefore to be preferred before any workarounds in our custom test framework.

    "extra": {
        "branch-alias": {
            "dev-master": "1.x-dev"
        }
    }

If that doesn't work, though, the best alternative is probably to set the $ORCA_SUT_BRANCH variable in you .travis.yml to something numeric corresponding to BLT's requirement, e.g., 1.x. That will cause Composer to identify it as dev-1.x

If both of those approaches fail, let me know and we'll see what we can figure out together.

danepowell commented 3 years ago

Perfect, thanks! Nice bit of lateral thinking.

I guess having a branch alias for your default branch should be considered best practice. I don't know how I've missed this until now. I've used branch aliases so many times but only as a hack, I never realized this was their true purpose 😄