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

Internal: Move Behat CI over to new PHP images #3429

Draft
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

Kingdutch
Copy link
Member

Problem

Our current CI images are difficult to maintain which makes testing different versions of PHP difficult.

Solution

Use the new dev images that are part of our SaaS build process which provide more versions.

Issue tracker

Internal CI issue no change.

How to test

  • Behat CI Should pass

Definition of done

Before merge

  • Code/peer review is completed
  • All commit messages are clear and clean. If applicable a rebase was performed
  • All automated tests are green
  • Functional/manual tests of the acceptance criteria are approved
  • All acceptance criteria were met
  • New features or changes to existing features are covered by tests, either unit (preferably) or behat
  • Update path is tested. New hook_updates should respect update order, right naming convention and consider hook_post_update code
  • Module can be safely uninstalled. Update/implement hook_uninstall and make sure that removed configuration or dependencies are removed/uninstalled
  • This pull request has all required labels (team/type/priority)
  • This pull request has a milestone
  • This pull request has an assignee (if applicable)
  • Any front end changes are tested on all major browsers
  • New UI elements, or changes on UI elements are approved by the design team
  • New features, or feature changes are approved by the product owner

After merge

  • Code is tested on all branches that it has been cherry-picked
  • Update hook number might need adjustment, make sure they have the correct order
  • The Drupal.org ticket(s) are updated according to this pull request status

@Kingdutch Kingdutch added team: bananas status: needs review This pull request is waiting for a requested review prio: medium type: repository Improvements to working with the repository (e.g. templates, README files, or workflows) labels Jun 20, 2023
@mergeable
Copy link

mergeable bot commented Jun 20, 2023

Thanks for contributing towards Open Social! A maintainer from the @goalgorilla/maintainers group might not review all changes from all teams/contributors. Please don't be discouraged if it takes a while. In the meantime, we have some automated checks running and it might be that you will see our comments with some tips or requests to speed up the review process. 😊

@Kingdutch Kingdutch force-pushed the internal/ci-new-images branch 16 times, most recently from 0e8707b to cead25d Compare June 27, 2023 14:49
The CI images are optimized differently (they use opcache like
production, but have assertions enabled like development).

The images now also include `jq` by default which means we don't need to
install it as CI step.
We (Alexander and Bram) have decided that for our new images we'll move
to using `/app` across development, CI and production to mirror our
current production set-up.

This means we need to fix where we work in GitHub actions to ensure our
paths are correct.
We need to use the new images which have the docker settings file where
we must provide connection details for the database and file system
through environment variables.
We were caching the previous Open Social version based on the commit
that we're testing, but the previous version doesn't actually change
with that commit.

So instead we cache it based on a few factors:

- The previous release number
- The contents of our workflow file
- The contents of our scaffold composer.json

That should ensure that we can re-use the previous installation across
our PRs (since the contents are constant) but also ensure we regenerate
it if we change our Behat workflow or our test scaffolding set-up.
The new image takes better care of how the user in the image is set
which ensures the ownership issue doesn't arise.
The CLI container has everything set-up to actually use the PHP tools
(like Drush) that we install.

We add an opensocial service which will run the PHP-FPM container that
the web container can route requests to.
This fixes the Behat tests in the CI but will break it in the local
development set-up until we migrate that to new images too.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
prio: medium status: needs review This pull request is waiting for a requested review type: repository Improvements to working with the repository (e.g. templates, README files, or workflows)
2 participants