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

Release v1.6.0 #211

Open
wants to merge 178 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
178 commits
Select commit Hold shift + click to select a range
2c73f5b
Remove <<EOF from deploy script
euanmillar May 9, 2024
42ccda9
Code freeze 1.5.0 release
rikukissa May 13, 2024
c3f14f5
feat: generate default address according to user's location (#978)
Zangetsu101 May 3, 2024
c09042b
[HOTFIX] Mass email subject & content styles (#983)
tahmidrahman-dsi May 7, 2024
290d4f5
fix: change gateway web url to internal swarm one (#990)
Zangetsu101 May 7, 2024
06f683e
docs: update CHANGELOG
Zangetsu101 May 14, 2024
0db9777
Merge branch 'release-v1.5.0' into cherry-pick-1.5-changes
Zangetsu101 May 14, 2024
469f888
Merge pull request #112 from opencrvs/cherry-pick-1.5-changes
Zangetsu101 May 14, 2024
7be22de
set owner for backup server authorized_keys to be the backup user
rikukissa May 15, 2024
12845b4
minor fix to how download script cleans backup directories before app…
rikukissa May 17, 2024
e3253dd
chore!: move configuration options (#1005)
Nil20 May 20, 2024
a4a37a5
Remove authentication from dashboard queries endpoint and update trae…
tahmidrahman-dsi May 21, 2024
f2e2816
fix: remove authentication from dashboard queries endpoint and update…
tahmidrahman-dsi May 27, 2024
58fb8cc
Update CHANGELOG.md
tahmidrahman-dsi May 27, 2024
9e7343a
Merge branch 'develop' of github.com:opencrvs/opencrvs-countryconfig …
tahmidrahman-dsi May 27, 2024
549acef
Remove unintended formatting changes
tahmidrahman-dsi May 27, 2024
86a0479
Merge pull request #123 from opencrvs/ocrvs-7016-countryconfig
tahmidrahman-dsi May 27, 2024
b6832e8
Update jq images to official ones to avoid deprecation breakage (#122)
n1koo May 27, 2024
d94f0e4
Update Docker and checkout actions to get rid of warnings (#121)
n1koo May 27, 2024
5042dc9
fix: add translations for different informants in print, issue & corr…
anamulhaquemollah May 30, 2024
6357748
Fix Correct item names in update modal for marriage declaration
tareq89 May 30, 2024
aba81fe
chore: update default users mobile format
Nil20 Jun 4, 2024
ae4b4c3
Merge pull request #124 from opencrvs/ocrvs-country-config-7046
naftis Jun 5, 2024
4027ae2
don't require regLastLocation in Postman Event Notification (#115)
naftis Jun 5, 2024
61bad39
fix: simplify hierarchy now that it can be queried through graphql (#…
naftis Jun 5, 2024
81b1da8
[OCRVS-7016] Fix typo in traefik router rule (#130)
tahmidrahman-dsi Jun 5, 2024
b972563
chore: remove `splitView` option from DOCUMENT_UPLOADER_WITH_OPTION f…
Zangetsu101 Jun 6, 2024
ddaf0e6
fix: show correct 'Place of Certification' in certificates (#131)
anamulhaquemollah Jun 7, 2024
db82ae6
feat: support for image compression configuration (#132)
tahmidrahman-dsi Jun 10, 2024
e83abd6
[OCRVS-6578] Metabase admin credentials environment variables (#128)
tahmidrahman-dsi Jun 11, 2024
4a85a6f
Update setup-environment.ts & deploy.sh to support non-default SSH po…
jhirvioja Jun 12, 2024
be0eaf1
Remove noise from development time logs (#138)
rikukissa Jun 13, 2024
e7efba5
fix: add query mapper for International Postal Code field
anamulhaquemollah Jun 14, 2024
59fe2a9
fix: remove extra quotes in translation file (#129)
jamil314 Jun 14, 2024
950f827
Merge pull request #109 from opencrvs/fix-docker-login
euanmillar Jun 14, 2024
bc4740f
[OCRVS-6986][OCRVS-7015][OCRVS-6590] Automate setting up SSH credenti…
rikukissa Jun 17, 2024
11bea8b
add auto release pr pipeline
rikukissa Jun 18, 2024
c5f9bed
Fix permission error when removing google authenticator file (#144)
rikukissa Jun 18, 2024
85d60ad
fix cherry-pick instructions
rikukissa Jun 18, 2024
1c6fba7
Merge branch 'develop' of github.com:opencrvs/opencrvs-countryconfig …
rikukissa Jun 18, 2024
f63a90d
Auto PR: explicitly define head branch for cherry-pick
rikukissa Jun 18, 2024
59cbf99
Auto PR: fetch all heads before trying auto cherry-pick
rikukissa Jun 18, 2024
23397ef
chore: update dashboard query with the recent correction flow changes…
tahmidrahman-dsi Jun 19, 2024
165c714
Merge pull request #133 from opencrvs/format-mobile-number
Nil20 Jun 19, 2024
49e8ca6
feat: handle semantic commit's in release auto-PRs (#152)
naftis Jun 20, 2024
a8c80e0
feat: add missing translation for: `correction requested`, `retry`, `…
jamil314 Jun 20, 2024
d638373
fix: update certified at message id for verify certificate (#150)
Nil20 Jun 20, 2024
29c8365
fix: add missing translations (#155)
Zangetsu101 Jun 21, 2024
0bd4c61
Ignore baseimage when deploying (#160)
n1koo Jun 25, 2024
fdc3a31
Enforce token for seedign roles and users (#165)
euanmillar Jun 25, 2024
6830099
fix: sms not being sent (#164)
naftis Jun 25, 2024
e86d964
Add .nvmrc for easier dev (#161)
n1koo Jun 26, 2024
86eda1a
fix: rename geojson endpoint to not tie implementations to example co…
naftis Jun 26, 2024
86de93d
[OCRVS-7259] Fix elasticsearch directories getting nested in the back…
rikukissa Jun 27, 2024
609a8b8
Change jumpserver hostnames in the inventory examples (#174)
rikukissa Jun 28, 2024
6229580
replace texts where jump machine is referred as backup
makelicious Jul 1, 2024
0fcbe7d
add missing reference to gh ci private key file in jump context
makelicious Jul 1, 2024
02942a5
add todo comment for easier search experience
makelicious Jul 1, 2024
daf881e
unify language by replacing replica with server
makelicious Jul 1, 2024
9902fd3
Merge pull request #176 from opencrvs/fix/server-setup-issues
makelicious Jul 1, 2024
6855381
feat: add missing translations for texts in `correct record?` modal (…
jamil314 Jul 2, 2024
00a9bf8
fix: improve informant name formatting for inProgress declaration ema…
tareq89 Jul 2, 2024
5246098
Make default production docker-compose assume a single-node cluster (…
rikukissa Jul 2, 2024
f472d5c
add assignee for cherry-pick PRs
rikukissa Jul 2, 2024
32dc293
fix(ocrvs-5086): show different label when father address matches
makelicious Jul 2, 2024
13b9bee
fix(ocrvs-5086): refactor getAddress to accept arrays for conditionals
makelicious Jul 3, 2024
d71bf5c
chore: add invalid date validation message (#184)
Nil20 Jul 3, 2024
3e3cf5f
fix: update witness section names (#185)
Nil20 Jul 3, 2024
e00238e
fix: enable auth for certs endpoint (#188)
Zangetsu101 Jul 3, 2024
b55d3fb
fix(ocrvs-5086): update primary address preview copy for informant an…
makelicious Jul 3, 2024
025b2a0
Merge pull request #183 from opencrvs/fix/ocrvs-5086-update-father-pr…
makelicious Jul 3, 2024
12f6204
fix(ocrvs-7324): remove duplicate sentences from copy
makelicious Jul 3, 2024
c97c902
Merge pull request #192 from opencrvs/fix/ocrvs-7324-duplicate-senten…
makelicious Jul 4, 2024
574d43a
Remove deprecated version from compose files
n1koo Jul 5, 2024
e48756d
Merge pull request #196 from opencrvs/remove_deprecated_versions_from…
n1koo Jul 5, 2024
dfc63d5
feat: add the new required review/preview section (#137)
Zangetsu101 Jul 9, 2024
7f3902d
fix: stop accessing response text multiple times (#195)
Zangetsu101 Jul 9, 2024
fa3ddde
chore: update weight at birth postfix (#201)
Zangetsu101 Jul 9, 2024
94d7981
chore(changelog): underline breaking and important changes (#194)
naftis Jul 9, 2024
5691206
added backup environment for resetting tw factor auth on backup envir…
euanmillar Jul 9, 2024
7d2bdaf
bump release number (#205)
euanmillar Jul 9, 2024
05ab199
docs: add breaking changes section (#207)
Zangetsu101 Jul 10, 2024
9154e29
fix: skip PR creation when milestone not set
Zangetsu101 Jul 10, 2024
17b4166
remove special characters from the password generation (#209)
euanmillar Jul 10, 2024
88e08ca
chore: bump release
Zangetsu101 Jul 11, 2024
73ec8fe
Merge branch 'master' into release-v1.6.0
Zangetsu101 Jul 11, 2024
516cf92
docs: remove duplicate entries
Zangetsu101 Jul 11, 2024
572ad24
chore: bump deploy tags
Zangetsu101 Jul 11, 2024
1ebc0f1
take off filesystem metric check from system and related alert
makelicious Jul 11, 2024
72c2b8e
take up docker module
makelicious Jul 11, 2024
619c19b
Use kibana access token for connections
makelicious Jul 11, 2024
d027232
use kibana_system account instead of elastic
makelicious Jul 12, 2024
eabdf46
add kibana_system_password to top level env
makelicious Jul 12, 2024
55d6562
remove reference to kibana_system from setup-users.sh
makelicious Jul 12, 2024
07ebadd
use elastic user on setup-config
makelicious Jul 12, 2024
1f74628
remove deprecated dependencies from elastic and kibana
makelicious Jul 12, 2024
1c29417
upgrade kibana to 8.14.3
makelicious Jul 15, 2024
08e2850
upgrade logstash to 8.14.3
makelicious Jul 15, 2024
8855e07
upgrade beats to 8.14.3
makelicious Jul 15, 2024
449c858
upgrade apm server to 7.17.22
makelicious Jul 15, 2024
4548fb5
revert log changes after debugging
makelicious Jul 15, 2024
f51e42a
widen search user privileges to accommodate reindex job
makelicious Jul 16, 2024
7681ad4
upgrade elastalert to 2.19
makelicious Jul 16, 2024
96886c9
use minimal access for search user
makelicious Jul 16, 2024
5cd3377
update index creation error check
makelicious Jul 16, 2024
0cd8751
add manage privilege back to search user
makelicious Jul 16, 2024
5fa77fa
add comment for error message check
makelicious Jul 17, 2024
af39423
fix cherry-pick inconsistencies
makelicious Jul 17, 2024
fd13426
set kibana_system password on setup-users.sh
makelicious Jul 18, 2024
eba09ad
stop creating ocrvs index as a part of elastic setup
makelicious Jul 25, 2024
4264ab1
stop creating ocrvs index before running migrations during cleanup
makelicious Jul 26, 2024
709c8d8
Restart and remove existing elastalert indices
makelicious Jul 29, 2024
1db4568
move restart to deploy script
makelicious Jul 30, 2024
8cfb6c8
Merge pull request #222 from opencrvs/auto-pr-release-v1.6.0-216-1656
makelicious Jul 30, 2024
969ff80
Include first commit to range, render commits to body
makelicious Jul 18, 2024
6221690
Merge pull request #223 from opencrvs/auto-pr-release-v1.6.0-217-4866
makelicious Jul 30, 2024
de13f8c
fix: remove overshadowing rect
Zangetsu101 Aug 1, 2024
283f2d6
chore: remove unused bg image
Zangetsu101 Aug 1, 2024
ce2ca8f
Merge pull request #228 from opencrvs/auto-pr-release-v1.6.0-224-19667
Zangetsu101 Aug 6, 2024
8b44980
🍒 Merge changes from PR #229 to release-v1.6.0 (#230)
github-actions[bot] Aug 7, 2024
27d8212
ignore unavailable indices upon delete
makelicious Aug 14, 2024
2e55820
Merge pull request #240 from opencrvs/auto-pr-release-v1.6.0-239-18469
makelicious Aug 14, 2024
e80f9cb
Serve client manifest and icons from country-config
tareq89 Aug 19, 2024
23d1c5e
explicitly specify from which branch the release tag should be create…
rikukissa Aug 21, 2024
d5b03bf
use release version instead of package.json version
rikukissa Aug 21, 2024
0db8684
add descriptive merge messages
rikukissa Aug 21, 2024
54f6922
remove the v-prefix from versions
rikukissa Aug 21, 2024
68d6c4d
update CHANGELOG
rikukissa Aug 21, 2024
5b19a8f
revert 1.5.0 CHANGELOG changes
rikukissa Aug 21, 2024
e586522
🍒 Merge changes from PR #247 to release-v1.6.0 (#249)
github-actions[bot] Aug 26, 2024
c07ec92
chore: protect individual certificate endpoint with token
Nil20 Aug 22, 2024
389dec8
chore: add event cert route in production
Nil20 Aug 22, 2024
b52bec4
chore: clean up redundant certificate route
Nil20 Aug 22, 2024
f12ae76
docs: update changelog(7464)
Nil20 Aug 27, 2024
fb2a589
chore: relocate certificate folder from data-seeding
Nil20 Aug 28, 2024
b0d02ef
Merge pull request #251 from opencrvs/auto-pr-release-v1.6.0-250-9957
Zangetsu101 Sep 2, 2024
57c72b5
fix: groom & bride signature not showing up in pdf
jamil314 Sep 2, 2024
2f7f7ff
Merge pull request #253 from opencrvs/auto-pr-release-v1.6.0-252-1960
Zangetsu101 Sep 3, 2024
561a524
Merge pull request #243 from opencrvs/auto-pr-release-v1.6.0-241-29513
Zangetsu101 Sep 4, 2024
b5599b3
fix: mutate logstash host to object before sending it to elastic
makelicious Sep 5, 2024
edb4484
add ecs-logstash to index config
makelicious Sep 5, 2024
50f3524
Merge pull request #257 from opencrvs/auto-pr-release-v1.6.0-256-30169
makelicious Sep 5, 2024
fa997d4
chore: add allowedFileFormat properties for signature fields
Nil20 Sep 11, 2024
4e1a8df
docs: update changelog for updating allowed file format for signatures
Nil20 Sep 12, 2024
2231e6e
feat: optionCondition to filter document select options
Zangetsu101 Sep 2, 2024
298e4ef
docs: update changelog
Zangetsu101 Sep 2, 2024
4472504
Merge pull request #263 from opencrvs/auto-pr-release-v1.6.0-254-6976
Zangetsu101 Sep 12, 2024
c5391c3
chore: amend changelog
Nil20 Sep 12, 2024
e64ee74
Merge pull request #260 from opencrvs/auto-pr-release-v1.6.0-259-10769
Zangetsu101 Sep 17, 2024
6afef76
chore: rename application config file
Nil20 Jul 11, 2024
a8da778
chore!: remove unused config messages
Nil20 Jul 11, 2024
fb461e9
Merge pull request #272 from opencrvs/ocrvs-release-7156
Zangetsu101 Sep 17, 2024
78b1edf
Placeholder commit for PR #244
invalid-email-address Aug 26, 2024
72fa314
Remove extra divider on Birth form's mother section
Siyasanga Aug 6, 2024
c29fc9c
Remove extra divider on Birth form's father section
Siyasanga Aug 7, 2024
4a0feb6
Remove extra divider on Death form's Spouse section
Siyasanga Aug 7, 2024
2c8215d
Rm extra divider on Marriage form's placeOfMarriageTitle
Siyasanga Aug 7, 2024
89abe56
Record the removing of dividers in CHANGELOG.md
Siyasanga Aug 19, 2024
4216d30
Merge pull request #248 from opencrvs/auto-pr-release-v1.6.0-244-16719
Zangetsu101 Sep 19, 2024
3f08d06
Merge branch 'release-v1.6.0' into auto-pr-release-v1.6.0-245-6744
Zangetsu101 Sep 19, 2024
5021822
Merge pull request #246 from opencrvs/auto-pr-release-v1.6.0-245-6744
Zangetsu101 Sep 19, 2024
a7f6706
chore: add route to serve record notification
Nil20 Sep 18, 2024
c134a3a
chore: improve record notification types
Nil20 Sep 18, 2024
86d507d
docs: update changelog for addtion of notification flag
Nil20 Sep 18, 2024
b27279e
docs: amend changelog for notification flag
Nil20 Sep 18, 2024
f3b1665
docs: rearrange notification flags CHANGELOG entry
Zangetsu101 Sep 19, 2024
de05cbc
fix: add output for reset job (#159)
Zangetsu101 Aug 6, 2024
f5e8689
docs: update CHANGELOG
Zangetsu101 Sep 19, 2024
2a01973
Merge pull request #277 from opencrvs/auto-pr-release-v1.6.0-159-14771
Zangetsu101 Sep 19, 2024
b3720ae
Merge pull request #275 from opencrvs/auto-pr-release-v1.6.0-274-31621
Zangetsu101 Sep 20, 2024
fa19a08
chore: add search placeholder copy
tahmidrahman-dsi Sep 26, 2024
3e10cdd
Merge pull request #283 from opencrvs/add-copy-advanced-search-placeh…
makelicious Sep 27, 2024
e8bd3e3
fix: remove extra divider in birth declaration form
jamil314 Sep 27, 2024
94420eb
Merge pull request #285 from opencrvs/auto-pr-release-v1.6.0-284-30483
Zangetsu101 Sep 27, 2024
ad3ba02
🍒 Merge changes from PR #293 to release-v1.6.0 (#295)
Oct 7, 2024
7bc2456
fix: update template transformers for fields `informantType`, `otherI…
tahmidrahman-dsi Oct 28, 2024
2f03a54
chore: update CHANGELOG.md
tahmidrahman-dsi Oct 28, 2024
0356577
Merge pull request #306 from opencrvs/auto-pr-release-v1.6.0-305-10839
tahmidrahman-dsi Oct 30, 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
261 changes: 261 additions & 0 deletions .github/workflows/auto-pr-to-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,261 @@
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
#
# OpenCRVS is also distributed under the terms of the Civil Registration
# & Healthcare Disclaimer located at http://opencrvs.org/license.
#
# Copyright (C) The OpenCRVS Authors located at https://github.com/opencrvs/opencrvs-core/blob/master/AUTHORS.

name: Auto PR to Release Branch

on:
pull_request:
types: [closed]
workflow_dispatch:
inputs:
pr_number:
description: 'PR number to process'
required: true
default: ''
dry_run:
description: 'Dry run'
required: false
default: false
type: boolean

jobs:
resolve-releases:
if: ${{ github.event_name == 'pull_request' && github.event.pull_request.merged == true || github.event_name == 'workflow_dispatch' }}
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.resolve-applicable-versions.outputs.matrix }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Get PR details from workflow dispatch
if: ${{ github.event_name == 'workflow_dispatch' }}
id: get_pr_details_dispatch
run: |
PR_NUMBER=${{ github.event.inputs.pr_number }}
PR_DATA=$(curl -s -H "Accept: application/vnd.github.v3+json" https://api.github.com/repos/opencrvs/opencrvs-countryconfig/pulls/$PR_NUMBER)
echo "MILESTONE=$(printf '%s' $PR_DATA | jq -r '.milestone.title')" >> $GITHUB_ENV
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}

- name: Get PR details from event
if: ${{ github.event_name == 'pull_request' }}
id: get_pr_details_event
run: |
echo "MILESTONE=${{ github.event.pull_request.milestone.title }}" >> $GITHUB_ENV
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}

- name: Check for milestone and if release branch exists
continue-on-error: true
id: resolve-applicable-versions
run: |
if [ -z "${{ env.MILESTONE }}" ] || [ "${{ env.MILESTONE }}" = "null" ]; then
echo "No milestone set. Exiting."
exit 1
fi

filter_versions() {
local input_version=$1

# List remote branches, extract versions, and sort them semantically
versions=$(git ls-remote --heads origin 'release-*' | awk -F'release-' '{print $2}' | sort -V)

# Filter out versions less than the input version
filtered_versions=$(echo "$versions" | awk -v input="$input_version" '
function compare_versions(v1, v2) {
split(v1, a, /[.v]/);
split(v2, b, /[.v]/);
for (i = 2; i <= 4; i++) {
if (a[i] < b[i]) return -1;
if (a[i] > b[i]) return 1;
}
return 0;
}
{
if (compare_versions($0, input) >= 0) {
print $0
}
}')

# Keep only the highest patch version for each minor version
echo "$filtered_versions" | awk -F. '
{
minor = $1 "." $2;
patches[minor] = $0;
}
END {
for (minor in patches) {
print patches[minor];
}
}' | sort -V
}

versions=$(filter_versions "${{ env.MILESTONE }}")
json_array=$(echo "$versions" | jq -R -s -c 'split("\n") | map(select(. != ""))')
echo "matrix=$json_array" >> $GITHUB_OUTPUT

create-pr:
needs: resolve-releases
runs-on: ubuntu-22.04
if: ${{ always() && needs.resolve-releases.result == 'success' }}

strategy:
fail-fast: false
matrix:
version: ${{fromJson(needs.resolve-releases.outputs.matrix)}}

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Get PR details from workflow dispatch
if: ${{ github.event_name == 'workflow_dispatch' }}
id: get_pr_details_dispatch
run: |
PR_NUMBER=${{ github.event.inputs.pr_number }}
PR_DATA=$(curl -s -H "Accept: application/vnd.github.v3+json" https://api.github.com/repos/opencrvs/opencrvs-countryconfig/pulls/$PR_NUMBER)
# printf escapes the newlines in the JSON, so we can use jq to parse output such as:
# "body": "![image](https://github.com/user-attachments/assets/8eee5bcf-7692-490f-a19f-576623e09961)\r\n",
echo "PR_ID=$(printf '%s' $PR_DATA | jq -r '.number')" >> $GITHUB_ENV
echo "PR_AUTHOR=$(printf '%s' $PR_DATA | jq -r '.user.login')" >> $GITHUB_ENV
echo "PR_MERGER=$(printf '%s' $PR_DATA | jq -r '.merged_by.login')" >> $GITHUB_ENV
echo "BASE_BRANCH=$(printf '%s' $PR_DATA | jq -r '.base.ref')" >> $GITHUB_ENV
echo "HEAD_BRANCH=$(printf '%s' $PR_DATA | jq -r '.head.ref')" >> $GITHUB_ENV
echo "PR_TITLE=$(printf '%s' $PR_DATA | jq -r '.title')" >> $GITHUB_ENV
echo "BASE_SHA=$(printf '%s' $PR_DATA | jq -r '.base.sha')" >> $GITHUB_ENV
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}

- name: Get PR details from event
if: ${{ github.event_name == 'pull_request' }}
id: get_pr_details_event
run: |
PR_NUMBER=${{ github.event.pull_request.number }}
echo "PR_ID=${{ github.event.pull_request.number }}" >> $GITHUB_ENV
echo "PR_AUTHOR=${{ github.event.pull_request.user.login }}" >> $GITHUB_ENV
echo "BASE_BRANCH=${{ github.event.pull_request.base.ref }}" >> $GITHUB_ENV
echo "HEAD_BRANCH=${{ github.event.pull_request.head.ref }}" >> $GITHUB_ENV
echo "PR_TITLE=${{ github.event.pull_request.title }}" >> $GITHUB_ENV

LATEST_COMMIT_SHA=$(gh pr view $PR_NUMBER --json commits --jq '.commits[-1].oid')
FIRST_COMMIT_SHA=$(gh pr view $PR_NUMBER --json commits --jq '.commits[0].oid')
echo "LATEST_COMMIT_SHA=${LATEST_COMMIT_SHA}" >> $GITHUB_ENV
echo "FIRST_COMMIT_SHA=${FIRST_COMMIT_SHA}" >> $GITHUB_ENV

PR_DETAILS=$(gh pr view $PR_NUMBER --json mergedBy)
MERGED_BY_LOGIN=$(echo "$PR_DETAILS" | jq -r '.mergedBy.login')
echo "PR_MERGER=$MERGED_BY_LOGIN" >> $GITHUB_ENV
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}

- name: Create and push the new branch for the PR
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
run: |
SEMANTIC_PR_TITLE="${{ env.PR_TITLE }}"
RELEASE_BRANCH="release-${{ matrix.version }}"
MILESTONE="${{ matrix.version }}"

# Check for semantic prefix
if [[ $SEMANTIC_PR_TITLE =~ ^(feat|fix|docs|style|refactor|perf|test|chore|build|ci|revert|wip|merge)\: ]]; then
SEMANTIC_PR_TITLE="${BASH_REMATCH[1]}(${MILESTONE}): ${SEMANTIC_PR_TITLE#*: }"
else
SEMANTIC_PR_TITLE="🍒 Merge changes from PR #${{ env.PR_ID }} to $RELEASE_BRANCH"
fi

PR_BODY="Automated PR to merge changes from develop to $RELEASE_BRANCH"

# Configure git
git config user.name "github-actions"
git config user.email "[email protected]"
git config advice.mergeConflict false

# Fetch and checkout the release branch
git fetch --all --unshallow
git checkout $RELEASE_BRANCH

# Create a new branch for the PR
NEW_BRANCH="auto-pr-$RELEASE_BRANCH-${{ env.PR_ID }}-$RANDOM"
git checkout -b $NEW_BRANCH

echo "First commit: ${{ env.FIRST_COMMIT_SHA }}"
echo "Latest commit: ${{ env.LATEST_COMMIT_SHA }}"
# NOTE: git cherry-pick range needs ~ to include the FIRST_COMMIT_SHA (https://stackoverflow.com/questions/1994463/how-to-cherry-pick-a-range-of-commits-and-merge-them-into-another-branch)
COMMIT_RANGE="${{ env.FIRST_COMMIT_SHA }}~..${{ env.LATEST_COMMIT_SHA }}"

if [ "${{ env.FIRST_COMMIT_SHA }}" == "${{ env.LATEST_COMMIT_SHA }}" ]; then
COMMIT_RANGE=${{ env.FIRST_COMMIT_SHA }}
fi

echo "Commit range: $COMMIT_RANGE"

# Attempt to cherry-pick the commits from the original PR
CHERRY_PICK_OUTPUT=$(git cherry-pick $COMMIT_RANGE 2>&1) || {
git cherry-pick --abort || true
# If cherry-pick fails, create a placeholder commit
echo "Cherry-pick failed. Creating placeholder commit."

GIT_LOG_ONELINE_OUTPUT=$(git log --oneline --no-decorate $COMMIT_RANGE)

git reset --hard
git commit --allow-empty -m "Placeholder commit for PR #${{ env.PR_ID }}"

# Add manual cherry-pick commands to the PR body
PR_BODY="${PR_BODY}

**I failed to cherry-pick the changes automatically because of the following:**

\`\`\`
$CHERRY_PICK_OUTPUT
\`\`\`

**To continue manually you can use these commands:**
\`\`\`
git fetch origin $NEW_BRANCH:$NEW_BRANCH
git fetch origin ${{ env.HEAD_BRANCH }}:${{ env.HEAD_BRANCH }}

git checkout $NEW_BRANCH
git reset --hard HEAD~1 # Remove placeholder commit
git cherry-pick $COMMIT_RANGE
\`\`\`


**Individual commits:**
\`\`\`
$GIT_LOG_ONELINE_OUTPUT
\`\`\`
"
}

if [ "${{ github.event.inputs.dry_run }}" == "true" ]; then
echo "This is a dry run."
echo "Would have pushed the new branch $NEW_BRANCH"
echo "PR title: $SEMANTIC_PR_TITLE"
echo "PR body:"
echo "$PR_BODY"
exit 0
fi

# Push the new branch
git push origin $NEW_BRANCH

# Create a pull request and assign the original PR author as the reviewer
AUTHOR=${{ env.PR_AUTHOR }}

if [[ $AUTHOR == *renovate* ]]; then
if [ -z "${{ env.PR_MERGER }}" ]; then
AUTHOR=""
else
AUTHOR=${{ env.PR_MERGER }}
fi
fi
gh pr create --title "$SEMANTIC_PR_TITLE" --body "$PR_BODY" --head "$NEW_BRANCH" --base "$RELEASE_BRANCH" --assignee "$AUTHOR" --reviewer "$AUTHOR"
3 changes: 3 additions & 0 deletions .github/workflows/clear-environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ jobs:
name: 'Reset data'
environment: ${{ github.event.inputs.environment }}
runs-on: ubuntu-22.04
outputs:
outcome: ${{ steps.reset-data.outcome }}
timeout-minutes: 60
steps:
- name: Clone country config resource package
Expand All @@ -45,6 +47,7 @@ jobs:
known_hosts: ${{ env.KNOWN_HOSTS }}

- name: Reset data
id: reset-data
env:
HOST: ${{ vars.DOMAIN }}
ENV: ${{ vars.ENVIRONMENT_TYPE }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ on:
core-image-tag:
description: Core DockerHub image tag
required: true
default: 'v1.5.0'
default: 'v1.6.0'
countryconfig-image-tag:
description: Your Country Config DockerHub image tag
required: true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ on:
core-image-tag:
description: Core DockerHub image tag
required: true
default: 'v1.5.0'
default: 'v1.6.0'
countryconfig-image-tag:
description: Your Country Config DockerHub image tag
required: true
Expand Down
11 changes: 11 additions & 0 deletions .github/workflows/get-secret-from-environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,17 @@ jobs:
exit 1
fi

- name: Verify GitHub token validity
id: verify-token
run: |
RESPONSE=$(curl -s -o /dev/null -w "%{http_code}" -H "Authorization: Bearer ${{ secrets.gh_token }}" \
"https://api.github.com/user")
if [ "$RESPONSE" -ne 200 ]; then
echo "Invalid or expired GitHub token."
exit 1
fi
echo "GitHub token is valid."

- name: Check if environment exists
id: check-env
run: |
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ on:
description: Branch to build from
default: master
required: true

release_version:
description: Release tag. It will be prepended by your repository name
description: Release tag. It will be prepended by your repository name (e.g. v1.5.3 or 20240501)
required: true

jobs:
Expand All @@ -22,12 +23,8 @@ jobs:
- name: Install jq
run: sudo apt-get install jq -y

- name: Read version from package.json
id: get_version
run: echo "::set-output name=version::$(jq -r '.version' package.json)"

- name: Set TAG environment variable
run: echo "TAG=v${{ steps.get_version.outputs.version }}" >> $GITHUB_ENV
run: echo "TAG=${{ github.event.inputs.release_version }}" >> $GITHUB_ENV

- uses: trstringer/manual-approval@v1
with:
Expand All @@ -45,6 +42,7 @@ jobs:
github_token: ${{ secrets.GITHUB_TOKEN }}
tag_prefix: ${{ github.event.repository.name }}-
custom_tag: ${{ env.TAG }}
release_branches: ${{ github.event.inputs.branch_name }}

- name: Login to DockerHub
uses: docker/login-action@v3
Expand Down Expand Up @@ -74,6 +72,7 @@ jobs:
type: now
from_branch: ${{ github.event.inputs.branch_name }}
target_branch: master
message: Merge ${{ github.event.inputs.branch_name }} to master
github_token: ${{ secrets.GITHUB_TOKEN }}

- name: Merge master -> develop
Expand All @@ -82,4 +81,5 @@ jobs:
type: now
from_branch: master
target_branch: develop
message: Merge master back to develop
github_token: ${{ secrets.GITHUB_TOKEN }}
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
18.20.2
Loading