Skip to content

Commit

Permalink
CH36 / Little Bugs (#596)
Browse files Browse the repository at this point in the history
* Use --ci option instead of --volumes for indicating that we don't want to use docker volumes.

* Fix for commit 23c51d3. In the create wizard, site nodes don't exist for a time, so the query must include environments with site == null.

* Test using devshop-composer-template instead

* Fix broken class arrays.

* Improve admin section for Server Access.

* Improve project templates admin section.

* Give create.js the data it expects, for now.

* On "project/add/settings" page, don't show the checkbox.

* Make checks for no_verify consistent with "empty()".

* Accidentally lost $output[] setting.

* Squashed cherry-pick of
dab7968...ffa7621

* Include unverified sites in project query.

Rewrite OR query to one condition per line

* change to empty to avoid notices.

* Add gcp as an alias for git cherry-pick.

* Clean up behat error reporting, including printing last drush output.

* Avoid PHP notices. It slows things down quite a bit when DBLog is active.

* Add a "Run in Terminal" button that outputs the command to trigger the task!

* Cleanup run in terminal button with kbd alert.

* Check more options to avoid printing in the wrong place.

* Create separate "View Logs" and "Retry" buttons. Make the Retry button go right to the confirm form.

* Let the hosting-queue-runner clear drush caches by itself, try to avoid strange missing module message:

> Command hosting-task needs the following extension(s) enabled to run:    [error]
> The drush command 'hosting-task 197' could not be executed.              [error]

* Use devshop-log, not log.

* Removing devshop_support_network_client from devmaster install profile and adding an update hook to disable it.

* Add --reinstall option to robo test.

* Bad update number.

* Use all git projects in devmaster dev and remove distro_update

* Bump to Drupal 7.73

* Build full drupal and makefile for now to reduce confusion until the rest of the integration work is done.

* Keep break step commented.

* Rename tested project to compose.

* Stopgap: pass future git platform properties to context so that latest provision 3.x works with devshop in soon-to-be-legacy

* Delete duplicate test file.

* Remove test for support widget.

* Ensure github PR queues respect the project settings by removing complex pull_request_create_policy feature that is impossible to calculate. Improve the form.

* Improve the github PR settings form and messaging.

* Fix create project form so that:
- GitHub PR environments are included in the main form, so that they get created on the spot just like ad-hoc environments.
- GitHub PR environments only show up when enabled.
- Show number of PRs and link to PRs even if disabled.
-

* Fix create project form so that:
- GitHub PR environments are included in the main form, so that they get created on submit of the form just like ad-hoc environments.
- GitHub PR environments only show up when enabled.
- Show number of PRs and link to PRs even if disabled.

* Remove dsm and unneeded UI.

* Fix error reporting about environment names already in use: highlight the right element and include the duplicate name in the error message.

* Fix incorrect link back to project settings from errored environments page.

* Update hosting_create_environment() to be used by the create site wizard by allowing it to skip site nodes, and replace ad-hoc code that did the same thing.

* Remove the extra environments list from the project create page.

* Save boolean for pr_environment in env settings so we know which envs to load PR data into later.

* Handle forked repos in new project wizard with alternate URLs and branches.

* Fix project name validation.

* Remove loading.gif reference that isn't there.

* Catch bad data exceptions when trying to load PR data.

* If environment/platform was already created, re-insert environment DB record on Step 3 submit. this function was lost when converting to hosting_create_environment().

* Remove mentions of master branch from behat tests.
  • Loading branch information
jonpugh authored Sep 21, 2020
1 parent 6739cd8 commit d7484b7
Show file tree
Hide file tree
Showing 36 changed files with 386 additions and 394 deletions.
1 change: 1 addition & 0 deletions .config.fish
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ abbr -a -- gd git diff
abbr -a -- gs git status
abbr -a -- gt git tag
abbr -a -- gco git checkout
abbr -a -- gcp git cherry-pick
abbr -a -- gp git push
abbr -a -- gpl git pull
abbr -a -- r bin/robo
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ jobs:
--vars "${ANSIBLE_VARS}" \
--tags "${ANSIBLE_TAGS}" \
--skip-tags "${ANSIBLE_SKIP_TAGS}" \
--volumes 0 \
--ci \
&& bin/github deployment:update --state=in_progress --description="Preparing Containers with robo up... Done." --log_url=${GITHUB_RUN_LOG_URL}#step:8:1 \
|| ( bin/github deployment:update --state=failure --description="Preparing Containers with robo up... Failed." --log_url=${GITHUB_RUN_LOG_URL}#step:8:1 && exit 1 )
Expand Down
24 changes: 13 additions & 11 deletions RoboFile.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ class RoboFile extends \Robo\Tasks {
'from' => 'FROM_IMAGE',
'os' => 'OS_VERSION',
'dockerfile' => 'DOCKERFILE',
'compose-file' => 'COMPOSE_FILE',
];

/**
Expand Down Expand Up @@ -219,7 +220,6 @@ public function prepareSourcecode($opts = [
'no-dev' => FALSE,
'devshop-version' => '1.x',
'test-upgrade' => FALSE,
'make' => 'profile',
]) {

if (empty($this->git_ref)) {
Expand Down Expand Up @@ -268,7 +268,7 @@ public function prepareSourcecode($opts = [
}

// If we want to just populate modules into /devmaster folder...
if ($opts['make'] == 'profile') {
// MAKE inside the devmaster profile
// Populate devmaster install profile with contrib code.
$makefile_path = 'build-devmaster-dev.make.yml';
$make_destination = 'devmaster/';
Expand All @@ -282,10 +282,8 @@ public function prepareSourcecode($opts = [
throw new \RuntimeException("Drush make failed with the exit code " . $result->getExitCode());
}
}
}
// Or if a whole Drupal build is needed.
elseif ($opts['make'] == 'drupal') {

// Also MAKE the entire drupal stack.
// Run drush make to build the devmaster stack.
$makefile_path = $opts['no-dev']? 'build-devmaster.make': "build-devmaster-dev.make.yml";
$make_destination = $this->devshop_root_path . "/aegir-home/devmaster-" . $opts['devshop-version'];
Expand All @@ -305,7 +303,6 @@ public function prepareSourcecode($opts = [
throw new \RuntimeException("Drush make failed with the exit code " . $result->getExitCode());
}
}
}

// Set git remote urls
if ($opts['no-dev'] == FALSE) {
Expand Down Expand Up @@ -474,7 +471,7 @@ public function prepareContainers($user_uid = NULL, $hostname = 'devshop.local.c
* @option $build Run `robo prepare:containers` to rebuild the container first.
* @option os-version An OS "slug" for any of the geerlingguy/docker-*-ansible images: https://hub.docker.com/u/geerlingguy/
* @option environment pass an environment variable to docker-compose in the form --environment NAME=VALUE
* @option volumes Set to TRUE to use the docker-compose.volumes.yml file to map local folders into the container.
* @option ci Set to TRUE when run in CI, such as in build.yml. If not set, docker-compose.volumes.yml will be included to produce a development environment.
* @option install-at-runtime Launch bare containers and then install devshop.
*/
public function up($docker_command = 'devshop-ansible-playbook', $opts = [
Expand Down Expand Up @@ -503,7 +500,7 @@ public function up($docker_command = 'devshop-ansible-playbook', $opts = [
'config' => '/usr/share/devshop/ansible.cfg',
'local' => FALSE,
'environment' => [],
'volumes' => true,
'ci' => FALSE,
'install-at-runtime' => FALSE,
'build-command' => NULL,
]) {
Expand Down Expand Up @@ -573,13 +570,13 @@ public function up($docker_command = 'devshop-ansible-playbook', $opts = [
if ($opts['mode'] == 'docker-compose') {

// Volumes
if ($opts['volumes']) {
if (!$opts['ci']) {
$this->yell('Volume mounts requested. Adding docker-compose.volumes.yml');
$this->say(' - ' . __DIR__ . '/aegir-home to /var/aegir');
$this->say(' - ' . __DIR__ . '/devmaster to /var/aegir/devmaster-1.x/profiles/devmaster');

// Set COMPOSE_FILE to include volumes.
putenv('COMPOSE_FILE=docker-compose.yml:docker-compose.volumes.yml');
$opts['compose-file'] = 'docker-compose.yml:docker-compose.volumes.yml';

if (!file_exists('aegir-home/devmaster-' . $this::DEVSHOP_LOCAL_VERSION) && !$opts['skip-source-prep']) {
$this->io()->warning('The aegir-home folder not present. Running prepare source code command.');
Expand Down Expand Up @@ -945,7 +942,8 @@ public function shell($user = 'aegir') {
* Run all devshop tests on the containers.
*/
public function test($user = 'aegir', $opts = array(
'compose-file' => 'docker-compose.yml',
'compose-file' => 'docker-compose.yml:docker-compose.volumes.yml',
'reinstall' => FALSE
)) {
$is_tty = !empty($_SERVER['XDG_SESSION_TYPE']) && $_SERVER['XDG_SESSION_TYPE'] == 'tty';
$no_tty = !$is_tty? '-T': '';
Expand All @@ -958,6 +956,10 @@ public function test($user = 'aegir', $opts = array(
$commands[] = "docker-compose exec $no_tty devshop chmod 777 /var/aegir/test-artifacts -R";
}

if ($opts['reinstall']) {
$commands[] = "docker-compose exec $no_tty --user $user devshop drush @hostmaster provision-install --force-reinstall";
}

$commands[] = "docker-compose exec $no_tty --user $user devshop /usr/share/devshop/tests/devshop-tests.sh";
$provision_io = new \DevShop\Component\PowerProcess\PowerProcessStyle($this->input, $this->output);
foreach ($commands as $command) {
Expand Down
5 changes: 4 additions & 1 deletion bin/hosting-queue-runner
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,8 @@ PATH="$DIR:$PATH"
export TIMEOUT=300
wait-site @hostmaster

log "Running drush @hostmaster hosting-queued ..."
devshop-log "Clearing drush caches ..."
drush cc drush

devshop-log "Running drush @hostmaster hosting-queued ..."
drush @hostmaster hosting-queued
2 changes: 1 addition & 1 deletion bin/wait-site
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ if [ -z "${ALIAS}" ]; then
exit 1
fi

OPTIONS=-n log "Checking database... "
OPTIONS=-n devshop-log "Checking database... "

# Returns true once mysql can connect.
# Thanks to http://askubuntu.com/questions/697798/shell-script-how-to-run-script-after-mysql-is-ready
Expand Down
13 changes: 11 additions & 2 deletions build-devmaster-dev.make.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ defaults:
projects:
drupal:
type: core
version: 7.72
download:
type: git
tag: 7.73

# DEVELOPERS: If submitting a Pull Request, CHANGE THE URL or BRANCH here, if you need to test devshop and devmaster repos.
devmaster:
Expand All @@ -20,7 +22,9 @@ projects:
url: devmaster

devel:
version: 1
download:
type: git
tag: 7.x-1.7

# The modules listed below override the settings in devmaster/drupal-org.make
# Each module is downloaded and checked out to the version specified here.
Expand All @@ -30,6 +34,11 @@ projects:
type: git
tag: 7.x-3.180-devshop

eldir:
download:
type: git
tag: 7.x-3.180

hosting_git:
download:
type: git
Expand Down
2 changes: 1 addition & 1 deletion build-devmaster.make
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ core = 7.x
api = 2

projects[drupal][type] = core
projects[drupal][version] = 7.72
projects[drupal][version] = 7.73

; RELEASE
; Leave in place for replacement by release process.
Expand Down
1 change: 0 additions & 1 deletion devmaster/devmaster.info
Original file line number Diff line number Diff line change
Expand Up @@ -75,5 +75,4 @@ dependencies[] = aegir_config
dependencies[] = devshop_permissions
dependencies[] = devshop_stats
dependencies[] = devshop_remotes
dependencies[] = devshop_support_network_client

2 changes: 1 addition & 1 deletion devmaster/drupal-org-core.make
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ api = 2
; - https://github.com/opendevshop/devshop/blob/1.x/build-devmaster-dev.yml
; - https://github.com/opendevshop/devshop/blob/1.x/build-devmaster-travis-forks.make.yml
projects[drupal][type] = core
projects[drupal][version] = 7.72
projects[drupal][version] = 7.73
1 change: 0 additions & 1 deletion devmaster/drupal-org.make
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ projects[views][version] = "3.24"
projects[views_bulk_operations][version] = "3.6"
projects[ctools][version] = "1.15"
projects[features][version] = "2.11"
projects[distro_update][version] = "1"
projects[module_filter][version] = "2.2"
projects[libraries][version] = 2.5
projects[token][version] = 1.7
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ function devshop_bitbucket_settings_form($form, &$form_state) {
$form['bitbucket_public_keys']['#prefix'] = '<div class="alert alert-danger">';
$form['bitbucket_public_keys']['#suffix'] = l('<i class="fa fa-bitbucket"></i> ' . t('Add devshop public key to your bitbucket account'), 'admin/devshop/bitbucket/add-key', array(
'attributes' => array(
'class' => 'btn btn-primary btn-large'
'class' => array('btn btn-primary btn-large'),
),
'html' => TRUE,
)) . '</div>';
Expand Down
Loading

0 comments on commit d7484b7

Please sign in to comment.