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

[CMSP-1140] Move cookie settings down to use Pantheon hostname #141

Conversation

jazzsequence
Copy link
Contributor

This pull request resolves a minor bug discovered while testing #140 in which HTTP_HOST was not defined when it was being called for the cookie settings.

Since this is the problem that PANTHEON_HOSTNAME solves, the PR moves the cookie settings down in the application.pantheon.php code so that we can use the PANTHEON_HOSTNAME value. This ensures that the cookie domain, admin cookie path, cookie path, and site cookie path are correctly defined for the Pantheon environment.

@jazzsequence jazzsequence requested review from a team as code owners July 17, 2024 14:50
@jazzsequence jazzsequence merged commit 857ff51 into cmsp-1140-add-tests-for-multisite Jul 17, 2024
6 checks passed
@jazzsequence jazzsequence deleted the cmsp-1140-fix-http-host-warning branch July 17, 2024 21:09
jazzsequence added a commit that referenced this pull request Jul 18, 2024
* abstract out the site_id and pass a site url to playwright
we can copy this pattern for subdomain and subdirectory multisites

* allow site name to come from environment

* move playwright tests to repeatable composate action

* run actions/checkout first
maybe remove this from composite?

* remove checkout from composite action

* Update playwright.yml to use the correct path for run-playwright-tests

* pass all the parameters from the workflow that has that info

* add shell

* add logging

* log the deletion, too

* pass the site name to the playwright tests

* fix broken colors

* add stdbuf to commands to log everything to the terminal

* shorten the names
so they're easier to read in the action workflow

* set the upstream id

* reference the action file directly

* create application.php files for subdir & subdom multisite

* copy the config file to the config/ directory

* absolutely do not use the action.yml path

* fix linting in two new files

* just use actual upstream IDs
instead of the upstream name

* remove comment
this isn't relevant anymore

* don't set the ID to the new ID
set the var to the id 🤦‍♂️

* check the multisite install when we status check

* fix broken conditional

* the conditional needs to wrap around the whole multisite block

* add a db reset before site install

* add the updated application.php file before the multisite check

* make sure we're in the right directory

* rename the file

* be specific about the type of multisite in the commit message

* move the wait to the top
so we can wait for the previous commit to finish

* use the correct site url (not the copy pasta one)

* display art for no good reason

* wait for the config to hit the server
because otherwise we're checking for the install status too early

* yeah 🤦‍♂️

* I guess we just can't do a colored logo

* set a max wait on the wait before installing graphql
because if a process is running, it'll wait longer, but if a process isn't (like we already waited earlier) then it's just going to use the long timeout

* only add the subsite if it doesn't already exist

* split the clone and copy updates apart
and put the multisite config in the middle
this way we're only waiting for sync_code once

* we do actually need the github token

* fix typo

* don't fail if there's nothing to commit

* just see if a foo site exists

* break the composite workflow into a script

* PRIVATE_KEY not SSH_KEY

* fix terminus token, too

* set defaults & move functions to the bottom

* shellcheck

* fix the other places inputs were broken

* fix secret name

* delete the sites when we're done

* remove any exits that aren't errors

* fix file copy globbing

* remove composite action

* move install dependencies into action & pantheon host key into script

* get last commit message and export to the environment

* remove host key command
we're still doing it in the action and it works for single site

* use the github token

* cd to the workspace

* need to get PR number

* echo the commit message for debugging

* use upstream name instead of id

* move playwright tests into the main workflow

* remove the blue var
unused

* need to install deps in single site

* multisite doesn't add host key
copy/pasta the two setups around keys and terminus so it's consistent

* rename run-playwright-tests to setup-

* Commit GraphQL to the repo

* move the workflow:wait to after we copy updates
because we're, again, checking multisite config before the commit is there

* use test instead of comparing value
i think this is failing because it's returning empty when it's not set

* don't use test, just run the command

* set connection to git always

* store the value of the config get in a var and check that

* install wp before doing status check

* fix subdir siet url vars

* force db reset

* the script shouldn't fail if foo site isn't found

* fix site title

* store site name and url in Github env

* normalize rest endpoint for multisite

* separately apply the filter to rest urls

* filter the rest endpoint, too

* remove all the wp-json handling

* adjust the playwright test to expect the api endpoint to be /wp/wp-json

* change the site name before we test the subsite

* the graphql endpoint changes if we're on a subsite, too

* flush the cache for the sub-site if we're doing multisite

* fix the toBeTruthy check

* echo with -e for color

* fix spacing

* only log in if not already logged in
allows you to run this locally with existing terminus token

* don't flush permalinks here
they're flushed after the site is created

* add tests for subdomain

* fix the subdom site url

* [CMSP-1140] Move cookie settings down to use Pantheon hostname (#141)

move cookie settings down so we can use pantheon hostname

* wrap PANTHEON_ENVIRONMENT with an isset

* remove the comment

Co-authored-by: Phil Tyler <[email protected]>

* make the globals readonly

TIL ✨

Co-authored-by: Phil Tyler <[email protected]>

* return early

don't exit because that bails the script

Co-authored-by: Phil Tyler <[email protected]>

* use `[[` instead of `[`

Co-authored-by: Phil Tyler <[email protected]>

* return early

Co-authored-by: Phil Tyler <[email protected]>

* one terminus command to activate wp-graphql

Co-authored-by: Phil Tyler <[email protected]>

* use brackets around commit msg

* use printf to handle single quotes in commit messages

* skip creating a new variable if we do not need it

Co-authored-by: Phil Tyler <[email protected]>

* strip out single quotes
this won't catch everything but maybe it'll catch what's breaking things now

* better handling of sed

* use printf

* strip newlines and carriage returns

* better commit message cleaning

---------

Co-authored-by: Phil Tyler <[email protected]>
jazzsequence added a commit that referenced this pull request Jul 31, 2024
* abstract out the site_id and pass a site url to playwright
we can copy this pattern for subdomain and subdirectory multisites

* allow site name to come from environment

* move playwright tests to repeatable composate action

* run actions/checkout first
maybe remove this from composite?

* remove checkout from composite action

* Update playwright.yml to use the correct path for run-playwright-tests

* pass all the parameters from the workflow that has that info

* add shell

* add logging

* log the deletion, too

* pass the site name to the playwright tests

* fix broken colors

* add stdbuf to commands to log everything to the terminal

* shorten the names
so they're easier to read in the action workflow

* set the upstream id

* reference the action file directly

* create application.php files for subdir & subdom multisite

* copy the config file to the config/ directory

* absolutely do not use the action.yml path

* fix linting in two new files

* just use actual upstream IDs
instead of the upstream name

* remove comment
this isn't relevant anymore

* don't set the ID to the new ID
set the var to the id 🤦‍♂️

* check the multisite install when we status check

* fix broken conditional

* the conditional needs to wrap around the whole multisite block

* add a db reset before site install

* add the updated application.php file before the multisite check

* make sure we're in the right directory

* rename the file

* be specific about the type of multisite in the commit message

* move the wait to the top
so we can wait for the previous commit to finish

* use the correct site url (not the copy pasta one)

* display art for no good reason

* wait for the config to hit the server
because otherwise we're checking for the install status too early

* yeah 🤦‍♂️

* I guess we just can't do a colored logo

* set a max wait on the wait before installing graphql
because if a process is running, it'll wait longer, but if a process isn't (like we already waited earlier) then it's just going to use the long timeout

* only add the subsite if it doesn't already exist

* split the clone and copy updates apart
and put the multisite config in the middle
this way we're only waiting for sync_code once

* we do actually need the github token

* fix typo

* don't fail if there's nothing to commit

* just see if a foo site exists

* break the composite workflow into a script

* PRIVATE_KEY not SSH_KEY

* fix terminus token, too

* set defaults & move functions to the bottom

* shellcheck

* fix the other places inputs were broken

* fix secret name

* delete the sites when we're done

* remove any exits that aren't errors

* fix file copy globbing

* remove composite action

* move install dependencies into action & pantheon host key into script

* get last commit message and export to the environment

* remove host key command
we're still doing it in the action and it works for single site

* use the github token

* cd to the workspace

* need to get PR number

* echo the commit message for debugging

* use upstream name instead of id

* move playwright tests into the main workflow

* remove the blue var
unused

* need to install deps in single site

* multisite doesn't add host key
copy/pasta the two setups around keys and terminus so it's consistent

* rename run-playwright-tests to setup-

* Commit GraphQL to the repo

* move the workflow:wait to after we copy updates
because we're, again, checking multisite config before the commit is there

* use test instead of comparing value
i think this is failing because it's returning empty when it's not set

* don't use test, just run the command

* set connection to git always

* store the value of the config get in a var and check that

* install wp before doing status check

* fix subdir siet url vars

* force db reset

* the script shouldn't fail if foo site isn't found

* fix site title

* store site name and url in Github env

* normalize rest endpoint for multisite

* separately apply the filter to rest urls

* filter the rest endpoint, too

* remove all the wp-json handling

* adjust the playwright test to expect the api endpoint to be /wp/wp-json

* change the site name before we test the subsite

* the graphql endpoint changes if we're on a subsite, too

* flush the cache for the sub-site if we're doing multisite

* fix the toBeTruthy check

* echo with -e for color

* fix spacing

* only log in if not already logged in
allows you to run this locally with existing terminus token

* don't flush permalinks here
they're flushed after the site is created

* add tests for subdomain

* fix the subdom site url

* [CMSP-1140] Move cookie settings down to use Pantheon hostname (#141)

move cookie settings down so we can use pantheon hostname

* wrap PANTHEON_ENVIRONMENT with an isset

* remove the comment

Co-authored-by: Phil Tyler <[email protected]>

* make the globals readonly

TIL ✨

Co-authored-by: Phil Tyler <[email protected]>

* return early

don't exit because that bails the script

Co-authored-by: Phil Tyler <[email protected]>

* use `[[` instead of `[`

Co-authored-by: Phil Tyler <[email protected]>

* return early

Co-authored-by: Phil Tyler <[email protected]>

* one terminus command to activate wp-graphql

Co-authored-by: Phil Tyler <[email protected]>

* use brackets around commit msg

* use printf to handle single quotes in commit messages

* skip creating a new variable if we do not need it

Co-authored-by: Phil Tyler <[email protected]>

* strip out single quotes
this won't catch everything but maybe it'll catch what's breaking things now

* better handling of sed

* use printf

* strip newlines and carriage returns

* better commit message cleaning

---------

Co-authored-by: Phil Tyler <[email protected]>
jazzsequence added a commit that referenced this pull request Aug 1, 2024
* abstract out the site_id and pass a site url to playwright
we can copy this pattern for subdomain and subdirectory multisites

* allow site name to come from environment

* move playwright tests to repeatable composate action

* run actions/checkout first
maybe remove this from composite?

* remove checkout from composite action

* Update playwright.yml to use the correct path for run-playwright-tests

* pass all the parameters from the workflow that has that info

* add shell

* add logging

* log the deletion, too

* pass the site name to the playwright tests

* fix broken colors

* add stdbuf to commands to log everything to the terminal

* shorten the names
so they're easier to read in the action workflow

* set the upstream id

* reference the action file directly

* create application.php files for subdir & subdom multisite

* copy the config file to the config/ directory

* absolutely do not use the action.yml path

* fix linting in two new files

* just use actual upstream IDs
instead of the upstream name

* remove comment
this isn't relevant anymore

* don't set the ID to the new ID
set the var to the id 🤦‍♂️

* check the multisite install when we status check

* fix broken conditional

* the conditional needs to wrap around the whole multisite block

* add a db reset before site install

* add the updated application.php file before the multisite check

* make sure we're in the right directory

* rename the file

* be specific about the type of multisite in the commit message

* move the wait to the top
so we can wait for the previous commit to finish

* use the correct site url (not the copy pasta one)

* display art for no good reason

* wait for the config to hit the server
because otherwise we're checking for the install status too early

* yeah 🤦‍♂️

* I guess we just can't do a colored logo

* set a max wait on the wait before installing graphql
because if a process is running, it'll wait longer, but if a process isn't (like we already waited earlier) then it's just going to use the long timeout

* only add the subsite if it doesn't already exist

* split the clone and copy updates apart
and put the multisite config in the middle
this way we're only waiting for sync_code once

* we do actually need the github token

* fix typo

* don't fail if there's nothing to commit

* just see if a foo site exists

* break the composite workflow into a script

* PRIVATE_KEY not SSH_KEY

* fix terminus token, too

* set defaults & move functions to the bottom

* shellcheck

* fix the other places inputs were broken

* fix secret name

* delete the sites when we're done

* remove any exits that aren't errors

* fix file copy globbing

* remove composite action

* move install dependencies into action & pantheon host key into script

* get last commit message and export to the environment

* remove host key command
we're still doing it in the action and it works for single site

* use the github token

* cd to the workspace

* need to get PR number

* echo the commit message for debugging

* use upstream name instead of id

* move playwright tests into the main workflow

* remove the blue var
unused

* need to install deps in single site

* multisite doesn't add host key
copy/pasta the two setups around keys and terminus so it's consistent

* rename run-playwright-tests to setup-

* Commit GraphQL to the repo

* move the workflow:wait to after we copy updates
because we're, again, checking multisite config before the commit is there

* use test instead of comparing value
i think this is failing because it's returning empty when it's not set

* don't use test, just run the command

* set connection to git always

* store the value of the config get in a var and check that

* install wp before doing status check

* fix subdir siet url vars

* force db reset

* the script shouldn't fail if foo site isn't found

* fix site title

* store site name and url in Github env

* normalize rest endpoint for multisite

* separately apply the filter to rest urls

* filter the rest endpoint, too

* remove all the wp-json handling

* adjust the playwright test to expect the api endpoint to be /wp/wp-json

* change the site name before we test the subsite

* the graphql endpoint changes if we're on a subsite, too

* flush the cache for the sub-site if we're doing multisite

* fix the toBeTruthy check

* echo with -e for color

* fix spacing

* only log in if not already logged in
allows you to run this locally with existing terminus token

* don't flush permalinks here
they're flushed after the site is created

* add tests for subdomain

* fix the subdom site url

* [CMSP-1140] Move cookie settings down to use Pantheon hostname (#141)

move cookie settings down so we can use pantheon hostname

* wrap PANTHEON_ENVIRONMENT with an isset

* remove the comment

Co-authored-by: Phil Tyler <[email protected]>

* make the globals readonly

TIL ✨

Co-authored-by: Phil Tyler <[email protected]>

* return early

don't exit because that bails the script

Co-authored-by: Phil Tyler <[email protected]>

* use `[[` instead of `[`

Co-authored-by: Phil Tyler <[email protected]>

* return early

Co-authored-by: Phil Tyler <[email protected]>

* one terminus command to activate wp-graphql

Co-authored-by: Phil Tyler <[email protected]>

* use brackets around commit msg

* use printf to handle single quotes in commit messages

* skip creating a new variable if we do not need it

Co-authored-by: Phil Tyler <[email protected]>

* strip out single quotes
this won't catch everything but maybe it'll catch what's breaking things now

* better handling of sed

* use printf

* strip newlines and carriage returns

* better commit message cleaning

---------

Co-authored-by: Phil Tyler <[email protected]>
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.

2 participants