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

test PR #109

Closed
wants to merge 73 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
73 commits
Select commit Hold shift + click to select a range
83c87e4
feat(YALB-1650): Add config to allow global blocks to be added and di…
codechefmarc Dec 4, 2023
e8e7d9d
refactor(YALB-1650): Refactor views tool to account for both layout b…
codechefmarc Dec 6, 2023
c08cb7c
fix(YALB-1650): Fixes saving of fields when not in layout builder
codechefmarc Dec 7, 2023
0bb01b4
feat(YALB-1650): Add messaging to global blocks when edited in layout…
codechefmarc Dec 7, 2023
90206ca
feat(YALB-1650): Add messaging to global block editing while in layou…
codechefmarc Dec 7, 2023
ca0e3aa
chore(YALB-1650): Move messaging logic out of views basic module and …
codechefmarc Dec 7, 2023
c5e8833
Merge branch 'develop' into YALB-1650--reusuable-global
codechefmarc Dec 7, 2023
b8453e7
feat(YALB-1650): CSS cleanup for Views Tool
codechefmarc Dec 12, 2023
a57c973
feat(YALB-1650): Finish CSS changes for views tool
codechefmarc Dec 12, 2023
753c98a
feat(YALB-1650): Add menu item to access global blocks
codechefmarc Dec 13, 2023
0983225
chore(YALB-1650): Add wingsuit back in composer.json, will remove aft…
codechefmarc Dec 13, 2023
144444a
Merge branch 'YALB-1654--bug-fix' into YALB-1650--reusuable-global
codechefmarc Dec 13, 2023
a1452a9
feat(YALB-1650): Changes from Yale feedback - grouping reusable block…
codechefmarc Dec 16, 2023
bd615ea
feat(YALB-1650): WIP - add changed, revised patch, and specific image…
codechefmarc Dec 19, 2023
56c8a16
chore(YALB-1650): Commit without patch first to have it re-read the n…
codechefmarc Dec 19, 2023
b6cb45e
chore(YALB-1650): Re-add patch
codechefmarc Dec 19, 2023
3878c0c
chore(YALB-1650): Rename patch to hopefully install it?
codechefmarc Dec 19, 2023
29b1676
feat(YALB-1650): Styling reusable block picker
codechefmarc Dec 19, 2023
ecb7206
feat(YALB-1650): Add ability to turn any block into a global block
codechefmarc Dec 20, 2023
5281e82
chore(YALB-1650): Revert addding global block from within layout builder
codechefmarc Dec 21, 2023
01cae3b
fix(YALB-1650): Fix linting error.
codechefmarc Dec 21, 2023
c5e6d55
fix(YALB-1650): Fix images on same block types
codechefmarc Dec 21, 2023
d5a4a4c
Merge branch 'develop' into YALB-1650--reusuable-global
codechefmarc Dec 21, 2023
86e2197
fix(YALB-1650): Fix changed display and sorting
codechefmarc Dec 22, 2023
1893be9
feat(YALB-1650): Add reusable option from within layout builder
codechefmarc Jan 2, 2024
51ac5e9
fix(YALB-1650): Fix layout builder not returning to view page after save
codechefmarc Jan 2, 2024
db1f336
Merge branch 'develop' into YALB-1650--reusuable-global
codechefmarc Jan 3, 2024
c1d6f9b
feat(YALB-1650): Fix permission issue. Also styling of layout builder…
codechefmarc Jan 3, 2024
e2f7664
fix(YALB-1650): Fix views flex radio buttons not wrapping
codechefmarc Jan 3, 2024
0699262
Merge branch 'develop' into YALB-1650--reusuable-global
codechefmarc Jan 8, 2024
4625f97
feat(YALB-1650): Add copy changes for reusuable blocks => global blocks
codechefmarc Jan 9, 2024
494c19f
feat(YALB-1650): Change title of content block view
codechefmarc Jan 9, 2024
6850f07
chore(YALB-1650): Rename Global to Reusable
codechefmarc Jan 10, 2024
bb9d86b
Merge branch 'develop' into YALB-1650--reusuable-global
codechefmarc Jan 10, 2024
e9b2300
chore(YALB-1650): WIP - Ajax issues for different versions of each form
codechefmarc Jan 16, 2024
35ae661
Merge branch 'develop' into YALB-1650--reusuable-global
codechefmarc Jan 16, 2024
12a55b0
fix(YALB-1650): WIP Fixes views basic to work with all three differen…
codechefmarc Jan 18, 2024
ee88e83
fix(YALB-1650): Fix linting errors, remove unused functions, prep for…
codechefmarc Jan 18, 2024
5c72df6
fix(YALB-1650): Fix typo with ternary operator
codechefmarc Jan 18, 2024
c32f564
Merge branch 'develop' into YALB-1650--reusuable-global
codechefmarc Jan 18, 2024
66e07de
Merge branch 'develop' into YALB-1650--reusuable-global
codechefmarc Jan 22, 2024
07fde53
fix(YALB-1650): Fix permissions for accessing block content overview …
codechefmarc Jan 22, 2024
ffc931d
chore(YALB-1650): Change readme to rebuild multidev
codechefmarc Jan 22, 2024
84ded98
fix: YALB-1704: Hotfix: block names missing in block picker (#550)
dblanken-yale Jan 31, 2024
fdd4df1
Merge branch 'develop' into YALB-1650--reusuable-global
codechefmarc Feb 1, 2024
9fa8a43
Merge branch 'develop' into master-into-develop-feb1-2024
dblanken-yale Feb 1, 2024
21ac99a
Merge pull request #556 from yalesites-org/master-into-develop-feb1-2024
dblanken-yale Feb 1, 2024
64b6e7f
Merge branch 'develop' into YALB-1650--reusuable-global
codechefmarc Feb 1, 2024
5caf7f3
Merge pull request #506 from yalesites-org/YALB-1650--reusuable-global
codechefmarc Feb 1, 2024
d75626d
YALB-520: Links: Dynamically apply link treatments (#467)
dblanken-yale Feb 2, 2024
992f825
feat(YALB-1568): Add body class with content type to support specific…
codechefmarc Feb 8, 2024
4b5c970
YALB-1703: Bug: Updating site settings changes home page path from pa…
dblanken-yale Feb 9, 2024
27f2180
feat(YALB-1681): support light and dark admin theme variations (#524)
joetower Feb 12, 2024
e3ec6f4
fix(YALB-1714): pin gin_lb module to ensure patch applies (#561)
nJim Feb 12, 2024
59d10f1
YSP-324: Deprecation warning in smart_date causes axe to find issue (…
dblanken-yale Feb 16, 2024
349b933
YALB-680: External source for content in lists (#552)
nJim Feb 20, 2024
9d0d462
feat: update atomic to 1.26.0
vinmassaro Feb 20, 2024
782b3ad
feat: add scripts and update github actions for release pull request …
vinmassaro Feb 20, 2024
b4b87e8
chore: add yalesites-reviewers as PR reviewer
vinmassaro Feb 20, 2024
8a49ef9
Merge pull request #569 from yalesites-org/release_pr_actions
vinmassaro Feb 20, 2024
e49850a
fix: set RELEASE_BRANCH either from previous step, or repo variable
vinmassaro Feb 21, 2024
58f93f9
Merge pull request #571 from yalesites-org/release_pr_fixes
vinmassaro Feb 21, 2024
492e924
chore: push code before creating multidev and increase wait time to 600s
vinmassaro Feb 21, 2024
d13e1da
Merge pull request #573 from yalesites-org/release_pr_fixes
vinmassaro Feb 21, 2024
09b80c3
fix: define unique github actions cache for pull request job
vinmassaro Feb 21, 2024
fa56ed7
Merge pull request #575 from yalesites-org/release_pr_fixes
vinmassaro Feb 21, 2024
164e6be
fix: set persistent variable name for release_pr cache
vinmassaro Feb 21, 2024
4e6899c
Merge pull request #577 from yalesites-org/release_pr_fix_cache
vinmassaro Feb 21, 2024
6d00f63
Update release_pr.yml
vinmassaro Feb 22, 2024
f1f3c02
Update README.md
vinmassaro Feb 22, 2024
7fd3985
restore readme
vinmassaro Feb 22, 2024
9636afa
Update release_pr.yml
vinmassaro Feb 22, 2024
b0f59a5
Merge branch 'develop' into actions-debug
vinmassaro Feb 22, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .ci/github/clean_up_multidevs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash -x

clean_up_multidevs() {
site_with_env="$1"
site_machine_name="${site_with_env%.*}"
terminus multidev:delete "$site_machine_name"."$RELEASE_BRANCH" --delete-branch -y
}

export -f clean_up_multidevs

# Get sites into array.
readarray -t release_sites <<< "$(tr -d '\r' <<< "$RELEASE_SITES")"

# Run cleanup with parallel.
parallel --jobs 0 --keep-order --line-buffer clean_up_multidevs ::: "${release_sites[@]}"

# Reset tracking variable for release site deployment.
gh variable set RELEASE_SITES_DEPLOYED --body "0"
18 changes: 14 additions & 4 deletions .ci/github/create_release_pull_request
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

set -eo pipefail

# If we aren't updating an existing pull request, create one to merge develop into master.
# If we aren't updating an existing pull request, create one to merge the release branch into master.
if [[ -z "$PR_NUMBER" ]]; then
pull_request_response=$(curl -s -H "Accept: application/vnd.github+json" \
-H "Authorization: token $ACCESS_TOKEN" \
-X POST -d '{"title": "Release", "head": "develop", "base": "master"}' \
-X POST -d '{"title": "Release '"$NEXT_VERSION"'", "head": "'"$RELEASE_BRANCH"'", "base": "master"}' \
"https://api.github.com/repos/$REPO/pulls")

message=$(echo "$pull_request_response" | jq -r 'if has("errors") then .errors[].message else null end')
message=$(echo "$pull_request_response" | jq -r 'if has("errors") then .errors[].message else empty end')

# Check if the pull request creation was successful.
if [[ -n "$message" ]]; then
Expand All @@ -23,6 +23,12 @@ if [[ -z "$PR_NUMBER" ]]; then
# Extract the pull request number from the response.
PR_NUMBER=$(echo "$pull_request_response" | jq -r '.number')

# Add reviewer to pull request.
gh pr edit "$PR_NUMBER" --add-reviewer yalesites-org/yalesites-reviewers

# Set PR_NUMBER for Github Actions.
echo PR_NUMBER="$PR_NUMBER" >> "$GITHUB_OUTPUT"

# If there is an existing PR number, get the PR.
else
pull_request_response=$(curl --silent -H "Authorization: token $ACCESS_TOKEN" \
Expand All @@ -31,6 +37,10 @@ else
pr_url=$(echo "$pull_request_response" | jq -r '.html_url')
fi

if [[ -z "$RELEASE_PR_URL" ]]; then
RELEASE_PR_URL="$pr_url"
fi

# Page through the /pulls/#/commits endpoint.
page=1
per_page=100
Expand Down Expand Up @@ -63,7 +73,7 @@ for sha in $commit_shas; do
"https://api.github.com/repos/$REPO/commits/$sha/pulls" \
| jq -r 'if type == "object" and has("message") and length > 0 then null else .[].html_url // empty end')

if [[ -n "$single_pr_url" && "$single_pr_url" != "null" ]]; then
if [[ -n "$single_pr_url" && "$single_pr_url" != "null" && "$single_pr_url" != "$RELEASE_PR_URL" ]]; then
pull_requests+=("$single_pr_url")
elif [[ "$single_pr_url" == "null" ]]; then
:
Expand Down
76 changes: 76 additions & 0 deletions .ci/github/deploy_release_sites
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
#!/bin/bash -x

set -eo pipefail

push_code() {
git_path=$(terminus connection:info "$site_with_env" --field=git_url)
git remote add "$site_machine_name" "$git_path"
git fetch "$site_machine_name"
git push "$site_machine_name" "$RELEASE_BRANCH:$RELEASE_BRANCH" --force
terminus workflow:wait "$site_machine_name"."$RELEASE_BRANCH" --max=600
}

drush_deploy() {
terminus -n env:wake "$site_machine_name"."$RELEASE_BRANCH"
echo -e "\nRunning drush deploy...\n"
terminus -n drush "$site_machine_name"."$RELEASE_BRANCH" -- deploy -v -y
}

process_site() {
site_with_env="$1"
site_machine_name="${site_with_env%.*}"

env_status=$(terminus env:info "$site_machine_name"."$RELEASE_BRANCH" --field=initialized 2>/dev/null)

# If multidev does not exist, create it, otherwise deploy code updates.
if [ "$env_status" != 1 ]; then
# Push release branch.
push_code

echo -e "\nCreating multidev $site_machine_name.$RELEASE_BRANCH from $site_with_env...\n"

if [ "$site_machine_name" = "yalesites-platform" ]; then
terminus multidev:create "$site_with_env" "$RELEASE_BRANCH" --no-db --no-files
else
terminus multidev:create "$site_with_env" "$RELEASE_BRANCH"
fi

# Do a fresh install on yalesites-platform site.
if [ "$site_machine_name" = "yalesites-platform" ]; then
echo -e "\nInstalling clean site for $site_machine_name.$RELEASE_BRANCH...\n"
terminus -n env:wake "$site_machine_name"."$RELEASE_BRANCH" --delay=20
terminus -n drush "$site_machine_name"."$RELEASE_BRANCH" -- si yalesites_profile -y
terminus -n drush "$site_machine_name"."$RELEASE_BRANCH" -- cr
SITE_MACHINE_NAME="$site_machine_name" env="$RELEASE_BRANCH" ./scripts/shared/content-import.sh
fi

drush_deploy

# Get site URL and output to file
site_url=$(terminus -n domain:list "$site_machine_name"."$RELEASE_BRANCH" --filter='type=platform' --field=id)
echo "- https://$site_url" >> output.txt
else
push_code
drush_deploy
fi
}

# Export functions so that GNU Parallel can access them
export -f push_code process_site drush_deploy

# Install Terminus Build Bools.
terminus self:plugin:install terminus-build-tools-plugin

# Get release sites and convert to an array.
readarray -t sites_array <<< "$(tr -d '\r' <<< "$RELEASE_SITES")"

# Process sites with parallel.
parallel --jobs 0 --keep-order --line-buffer process_site {} ::: "${sites_array[@]}"

echo "Environments ready for review:" | cat - output.txt > temp && mv temp output.txt

# If release sites don't exist, post a comment with URLs and set tracking variable to 1.
if [ "$RELEASE_SITES_DEPLOYED" == 0 ]; then
gh issue comment "$PR_NUMBER" --body-file output.txt
gh variable set RELEASE_SITES_DEPLOYED --body "1"
fi
93 changes: 78 additions & 15 deletions .github/workflows/release_pr.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,84 @@
name: Create/update release pull request
name: Release pull request
on:
pull_request:
branches:
- master
types:
- synchronize
workflow_dispatch:
env:
YALESITES_BUILD_TOKEN: ${{ secrets.YALESITES_BUILD_TOKEN }}
GH_TOKEN: ${{ secrets.YALESITES_BUILD_TOKEN }}
ACCESS_TOKEN: ${{ secrets.YALESITES_BUILD_TOKEN }}
REPO: ${{ github.repository }}
PR_NUMBER: ${{ github.event.number }}
RELEASE_PR_URL: ${{ github.event.pull_request._links.html.href }}
RELEASE_SITES: ${{ vars.RELEASE_SITES }}
jobs:
create_pull_request:
if: github.head_ref == 'develop' ||
github.event_name == 'workflow_dispatch'
setup:
runs-on: ubuntu-latest
env:
ACCESS_TOKEN: ${{ secrets.YALESITES_BUILD_TOKEN }}
REPO: ${{ github.repository }}
PR_NUMBER: ${{ github.event.number }}
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Create pull request
run: ./.ci/github/create_release_pull_request
- name : machine echo env
env : { CONTENT : "${{ toJson(env) }}" }
run : "echo $CONTENT"
- name : machine echo secrets
env : { CONTENT : "${{ toJson(secrets) }}" }
run : "echo $CONTENT"
- name : machine echo github
env : { CONTENT : "${{ toJson(github) }}" }
run : "echo $CONTENT"
- name : machine echo runner
env : { CONTENT : "${{ toJson(runner) }}" }
run : "echo $CONTENT"
- name : machine echo job
env : { CONTENT : "${{ toJson(job) }}" }
run : "echo $CONTENT"
- name : machine echo strategy
env : { CONTENT : "${{ toJson(strategy) }}" }
run : "echo $CONTENT"
- name : machine echo matrix
env : { CONTENT : "${{ toJson(matrix) }}" }
run : "echo $CONTENT"
- name : machine echo steps
env : { CONTENT : "${{ toJson(steps) }}" }
run : "echo $CONTENT"
- name : machine echo $GITHUB_ACTOR
run : "echo $GITHUB_ACTOR"
- name : machine echo $GITHUB_EVENT_NAME
run : "echo $GITHUB_EVENT_NAME"
- name : machine echo $GITHUB_ACTIONS
run : "echo $GITHUB_ACTIONS"
- name : machine echo $GITHUB_WORKFLOW
run : "echo $GITHUB_WORKFLOW"
- name : machine echo $GITHUB_ACTION
run : "echo $GITHUB_ACTION"
- name : machine echo $GITHUB_REPOSITORY
run : "echo $GITHUB_REPOSITORY"
- name : machine echo $GITHUB_BASE_REF
run : "echo $GITHUB_BASE_REF"
- name : machine echo $GITHUB_HEAD_REF
run : "echo $GITHUB_HEAD_REF"
- name : machine echo $GITHUB_REF
run : "echo $GITHUB_REF"
- name : machine echo $GITHUB_SHA
run : "echo $GITHUB_SHA"
- name : machine echo $GITHUB_EVENT_PATH
run : "echo $GITHUB_EVENT_PATH"
- name : machine echo $GITHUB_WORKSPACE
run : "echo $GITHUB_WORKSPACE"
- name : machine echo $HOME
run : "echo $HOME"
- name : container ls $GITHUB_EVENT_PATH
with : { entrypoint : "/bin/sh" , args : '-c "ls -la $GITHUB_EVENT_PATH"' }
uses : "docker://alpine:latest"
- name : container ls $GITHUB_WORKSPACE
with : { entrypoint : "/bin/sh" , args : '-c "ls -la $GITHUB_WORKSPACE"' }
uses : "docker://alpine:latest"
- name : container ls $HOME
with : { entrypoint : "/bin/sh" , args : '-c "ls -la $HOME"' }
uses : "docker://alpine:latest"
- name : machine ls $GITHUB_EVENT_PATH
run : "ls -la $GITHUB_EVENT_PATH"
- name : machine ls $GITHUB_WORKSPACE
run : "ls -la $GITHUB_WORKSPACE"
- name : machine ls $HOME
working-directory : "."
run : "ls -la $HOME"
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# YaleSites Project.
# YaleSites Project

The YaleSites platform empowers the Yale community to create digital experiences for the web in applications that are secure, cost-effective, accessible, and sustainable. This project repository contains the tooling, configuration, and scaffolding required to create sites on the platform. This project includes:

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@
"test": "./scripts/local/test.sh"
},
"devDependencies": {
"@semantic-release/git": "^10.0.1",
"@yalesites-org/eslint-config-and-other-formatting": "^1.5.0",
"eslint-config-drupal": "^5.0.2",
"eslint-plugin-jsx-a11y": "^6.5.1",
"eslint-plugin-react": "^7.29.4",
"eslint-plugin-yml": "^0.14.0",
"semantic-release": "^23.0.0",
"semantic-release-replace-plugin": "^1.2.7",
"shelljs": "^0.8.5"
},
Expand Down
Loading
Loading