⚠️ Please don't merge after approving. We need to update the wiki to account for these changes.
This PR updates saké to remove hardcoded references to SkyVerge on various tasks. Specifically:
Removes SkyVerge as the default SVN username
Replaces the DROPBOX_PATH environment variable with SAKE_PRE_RELEASE_PATH
Makes WP_SVN_USER environment variable required for deploy if deploy type is wp
Makes SAKE_PRE_RELEASE_PATH environment variable required for deploy
Removes wc-plugins-sales-docs as the default docs repo
Does not offer to create a docs issue unless the docs repository is specified using the DEPLOY_DOCS environment variable or providing the repo owner and repo slug through config.deploy.docs configuration entry
Removes skyverge as the default repo owner in github:create_release task
Additionally, this PR updates the get getGithub() helper function to use different instances of the client based on the task being performed: dev, docs, or production. The function continues to use the value of the GITHUB_API_KEY environment variable as the personal access by default, but now it can be overridden in specific cases using the SAKE_DEV_GITHUB_API_KEY, SAKE_DOCS_GITHUB_API_KEY, and SAKE_PRODUCTION_GITHUB_API_KEY.
The new environment variables should allow us to use a different personal access token to create releases on the new plugin repos and on the mirror repos while running the deploy task.
These modifications to remove the hardcoded references can be considered braking changes because they require extra environment variables to be defined in order to continue using sake as before. However, I think we can't avoid having to define extra environment variables to be able to use different personal access tokens to create releases in repos from different organizations, so extra cost from the changes to remove the references is small. No changes to existing configuration files should be required.
cd into the sake repository, checkout this branch and run npm link to make the sake binary from this branch globally available
Ensure GITHUB_API_KEY has a personal access token with permissions to access the repositories in the gdcorp-partners organization
Define environment variable WP_SVN_USER with SkyVerge as the value
Define environment variable DEPLOY_DOCS with skyverge/wc-plugins-sales-docs as the value
Define environment variable SAKE_PRE_RELEASE_PATH with ${DROPBOX_PATH}/skyverge-prereleases/ as the value
Define environment variable SAKE_PRODUCTION_GITHUB_API_KEY with a personal access token with permissions to create releases on WooCommerce mirror repos as the value
Prepare the plugin for deploy (bump the development version) and commit the changes
Run export SAKE_DEV_GITHUB_API_KEY={token} where {token} is a personal access token with permission to update repositories in the SkyVerge organization. Most likely the same token used for SAKE_PRODUCTION_GITHUB_API_KEY is going to work here. This step is necessary because the development repo belongs to an organization that cannot be accessed using the default GITHUB_API_KEY
Run sake deploy (instead of npx sake deploy) to deploy a new version of the plugin
[x] The tasks are completed without errors
[x] A release was created in the development repo
[x] Changes were committed to the local SVN repo
SSH/Git configuration
You may need to update your SSH/Git configuration to work with repos that belong to your GoDaddy account.
Summary
⚠️ Please don't merge after approving. We need to update the wiki to account for these changes.
This PR updates saké to remove hardcoded references to SkyVerge on various tasks. Specifically:
SkyVerge
as the default SVN usernameDROPBOX_PATH
environment variable withSAKE_PRE_RELEASE_PATH
WP_SVN_USER
environment variable required for deploy if deploy type iswp
SAKE_PRE_RELEASE_PATH
environment variable required for deploywc-plugins-sales-docs
as the default docs repoDEPLOY_DOCS
environment variable or providing the repo owner and repo slug throughconfig.deploy.docs
configuration entryskyverge
as the default repo owner ingithub:create_release
taskAdditionally, this PR updates the get
getGithub()
helper function to use different instances of the client based on the task being performed:dev
,docs
, orproduction
. The function continues to use the value of theGITHUB_API_KEY
environment variable as the personal access by default, but now it can be overridden in specific cases using theSAKE_DEV_GITHUB_API_KEY
,SAKE_DOCS_GITHUB_API_KEY
, andSAKE_PRODUCTION_GITHUB_API_KEY
.The new environment variables should allow us to use a different personal access token to create releases on the new plugin repos and on the mirror repos while running the
deploy
task.These modifications to remove the hardcoded references can be considered braking changes because they require extra environment variables to be defined in order to continue using sake as before. However, I think we can't avoid having to define extra environment variables to be able to use different personal access tokens to create releases in repos from different organizations, so extra cost from the changes to remove the references is small. No changes to existing configuration files should be required.
Story: CH 72087
QA
Setup
cd
into the sake repository, checkout this branch and runnpm link
to make thesake
binary from this branch globally availableGITHUB_API_KEY
has a personal access token with permissions to access the repositories in thegdcorp-partners
organizationWP_SVN_USER
withSkyVerge
as the valueDEPLOY_DOCS
withskyverge/wc-plugins-sales-docs
as the valueSAKE_PRE_RELEASE_PATH
with${DROPBOX_PATH}/skyverge-prereleases/
as the valueSAKE_PRODUCTION_GITHUB_API_KEY
with a personal access token with permissions to create releases on WooCommerce mirror repos as the valueCode Review
Test WC deploy
sake.config.js
as follows, replacing the Git URL for the forked production repo:sake.config.js
sake deploy
(instead ofnpx sake deploy
) to deploy a new version of the plugin but don't upload the plugin to WC.com (answer N to the prompt)Test WP deploy
sake.config.js
as follows, replacing the path to the SVN repo:sake.config.js
export SAKE_DEV_GITHUB_API_KEY={token}
where{token}
is a personal access token with permission to update repositories in the SkyVerge organization. Most likely the same token used forSAKE_PRODUCTION_GITHUB_API_KEY
is going to work here. This step is necessary because the development repo belongs to an organization that cannot be accessed using the defaultGITHUB_API_KEY
sake deploy
(instead ofnpx sake deploy
) to deploy a new version of the pluginSSH/Git configuration
You may need to update your SSH/Git configuration to work with repos that belong to your GoDaddy account.
I'm using the configuration described in https://gist.github.com/wvega-godaddy/51f74951a6d0af85d40f22a220cd0e83 and had to update my
~/.gitconfig
file to add:Before merge