Skip to content

Commit 2a3146a

Browse files
authored
Ensure the DevShop Control Project template installs the latest alpha of devshop/devmaster. (#629)
* Ensure devmaster is at least 1.7 * Run component tests twice a day just like the main tests. * Run composer reinstall to keep CI consistent with developer commands. * Use "^1.7@alpha" or "1.x-dev". * Checkout a local 1.x branch from the current SHA to trick composer into thinking it's on 1.x-dev. * Use minimum-stability alpha so we can just use ^1.7 without the @Alpha tag. #629
1 parent d2afe55 commit 2a3146a

3 files changed

Lines changed: 19 additions & 4 deletions

File tree

.github/workflows/components.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,11 @@ on:
55
branches: 1.x
66
pull_request:
77
types: [opened, synchronize]
8-
8+
workflow_dispatch:
99
schedule:
1010
# Once per day. https://crontab.guru/#*_0_*_*_*
1111
- cron: "* 0 * * *"
12+
- cron: "0 12 * * *"
1213

1314
env:
1415
GITHUB_TOKEN: ${{ secrets.INPUT_GITHUB_TOKEN }}
@@ -269,7 +270,7 @@ jobs:
269270

270271
# If installing without a lockfile, composer suggests using "update" command instead.
271272
- name: Install dependencies
272-
run: composer update --prefer-dist --no-progress
273+
run: composer reinstall
273274
working-directory: ${{env.working-directory}}
274275

275276
- name: Test Project Creation
@@ -278,3 +279,5 @@ jobs:
278279
working-directory: ./src/DevShop/Component/
279280
run: |
280281
composer create-project devshop/control-template:@dev temp --repository='{"type":"path","url":"DevShopControlTemplate"}'
282+
283+
# @TODO: Launch a devshop test container around this devshop-control code.

.github/workflows/devshop-container-prep.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,17 @@ PATH="$DEVSHOP_PATH/bin:$PATH"
55
GIT_REF=${GITHUB_HEAD_REF:-"1.x"}
66

77
devshop-logo "Preparing DevShop Control for CI Tests"
8+
devshop-log "Creating local branch from the checked out commit with the expected name..."
9+
10+
# Create a local branch in the "path" repo so that composer doesn't get all confused. When the path is a SHA, composer reads the version as `devshop/devmaster[dev-8207dc45845c7cc0e4e8271d9c097fcb108a5773]`
11+
# Assumption: Having a local branch will make composer detect the devshop/devmaster repo as being at version `devshop/devmaster[1.x-dev]`.
12+
# I discovered this is happening by noticing that local composer install fails had a different error message:
13+
# In GitHub Actions: https://github.com/opendevshop/devshop/pull/629/checks?check_run_id=1392567826#step:4:227
14+
# - Root composer.json requires devshop/devmaster ^1.7@alpha||1.x-dev, it is satisfiable by devshop/devmaster[1.7.0-alpha1, 1.7.0-alpha2, 1.7.0-alpha3, 1.x-dev] from composer repo (https://repo.packagist.org) but devshop/devmaster[dev-8207dc45845c7cc0e4e8271d9c097fcb108a5773] from path repo (/usr/share/devshop/devmaster) has higher repository priority.
15+
# Locally, it says `devshop/devmaster[1.x-dev]` instead, because my local path repo is on a branch.
16+
17+
cd "$DEVSHOP_PATH"
18+
git checkout -b 1.x
819

920
devshop-log "Adding repos to composer global config."
1021
set -x

src/DevShop/Component/DevShopControlTemplate/composer.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,11 @@
3434
"composer/installers": "^1.2",
3535
"composer/semver": "^1.4",
3636
"cweagans/composer-patches": "dev-master#a18d1ca",
37-
"devshop/devmaster": "@dev",
37+
"devshop/devmaster": "^1.7||1.x-dev",
3838
"drupal-composer/preserve-paths": "dev-composer2",
3939
"drupal/admin_menu": "@rc",
4040
"drupal/adminrole": "^1.1",
41-
"drupal/aegir_config": "@beta",
41+
"drupal/aegir_config": "@beta",
4242
"drupal/aegir_ssh": "^1.0",
4343
"drupal/betterlogin": "^1.5",
4444
"drupal/bootstrap": "^3.26",
@@ -150,5 +150,6 @@
150150
"web/profiles"
151151
]
152152
},
153+
"minimum-stability": "alpha",
153154
"prefer-stable": true
154155
}

0 commit comments

Comments
 (0)