Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
aa7a8ed
docs: updates on documentation
Jan 28, 2021
b1fbb3c
docs: updates on documentation
Jan 29, 2021
b6aec63
docs: updates on documentation
Jan 29, 2021
a767277
docs: updates on documentation
Feb 1, 2021
696fa3f
docs: updates on documentation
Feb 1, 2021
de2cb17
docs: updates on documentation
Feb 2, 2021
53af7b1
docs: updates on documentation
Feb 2, 2021
69fac7c
docs: updates on workflows
Feb 3, 2021
9669a18
docs: updates on documentation
Feb 4, 2021
775e3c2
docs: updates on documentation
Feb 4, 2021
d4bb8b7
docs: updates on documentation
Feb 4, 2021
596bf06
docs: updates on documentation
Feb 6, 2021
fd83c8f
docs: updates on documentation
Feb 6, 2021
5f5730f
docs: updates on documentation
Feb 6, 2021
7adfab5
docs: updates on documentation
Feb 6, 2021
3ac430e
docs: updates on documentation
Feb 7, 2021
9291a04
docs: updates on documentation
Feb 9, 2021
e717396
docs: updates on documentation
Feb 9, 2021
82fd898
docs: updates on documentation
Feb 10, 2021
213d076
docs: updates on documentation
Feb 26, 2021
08231d1
docs: updates on documentation
Feb 26, 2021
891ce01
docs: updates on documentation
Feb 26, 2021
e24a30e
docs: updates on documentation
Apr 5, 2021
0131c3c
docs: updates on documentation
Apr 5, 2021
386102b
docs: updates on documentation
Apr 6, 2021
111777c
docs: updates on documentation
Apr 6, 2021
6c24766
docs: updates on documentation
Apr 14, 2021
7d81524
docs: updates on documentation
Apr 21, 2021
a7830c0
docs: updates on documentation
Apr 21, 2021
721b6cc
docs: updates on documentation
Apr 22, 2021
89b7736
docs: updates on documentation
Apr 23, 2021
eff66c8
docs: updates on documentation
Apr 23, 2021
d4cab0d
docs: updates on documentation
Apr 23, 2021
1563192
Updated CHANGELOG.md
github-actions[bot] Apr 24, 2021
f988440
docs: updates on documentation
May 21, 2021
9ae8f95
Added info on workflows
Jun 23, 2021
4da1593
Added info on workflows
Jul 2, 2021
b2e61e8
Added info on workflows
Jul 4, 2021
4d15d9d
Added info on workflows
Jul 20, 2021
587c982
Added info on workflows
Jul 23, 2021
af8ace7
Updates on files
Nov 19, 2021
1c9ac29
Updates on files
Nov 20, 2021
1d5efb1
Updates on files
Nov 26, 2021
0c7e62b
Update on files
Dec 18, 2021
963f8e3
Updates on files
Dec 26, 2021
2fc717a
Updates on files
Dec 30, 2021
55283f5
Updates on files
Mar 26, 2022
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
5 changes: 5 additions & 0 deletions .bettercodehub.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
component_depth: 6
default_excludes: true
languages:
- java
- kotlin
8 changes: 8 additions & 0 deletions .deepsource.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
version = 1

[[analyzers]]
name = "java"
enabled = true

[analyzers.meta]
runtime_version = "11"
3 changes: 3 additions & 0 deletions .github/dco.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Disable sign-off chcecking for members of the Gradle GitHub organization
require:
members: false
10 changes: 10 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
version: 2
updates:
- package-ecosystem: "gradle"
directory: "/"
schedule:
interval: "daily"
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
21 changes: 21 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name-template: $NEXT_MINOR_VERSION
tag-template: v$NEXT_MINOR_VERSION

categories:
- title: 🚀 New features and improvements
labels:
- enhancement
- title: 🐛 Bug Fixes
labels:
- bug
- title: 🚦 Internal changes
labels:
- internal

exclude-labels:
- no-changelog
- duplicate
- invalid

template: |
$CHANGES
9 changes: 9 additions & 0 deletions .github/scripts/build-release-note.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash

set -e

echo "Changelog:"
TAG=$(echo "refs/tags/$1" | sed "s/.*tags\///g")
START="### v$TAG"
END="###"
sed -n "/^$START$/,/$END/p" CHANGELOG.md | sed '1d' | sed '$d' | sed '$d'
27 changes: 27 additions & 0 deletions .github/scripts/close-pending.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/usr/bin/env bash

set -e

SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"
MESSAGE=$(cat $SCRIPT_DIR/closing-message.txt)

while IFS= read -r number &&
IFS= read -r title; do
echo "Closing PR ($number): $title"
curl -s -o /dev/null \
-X POST \
--data "$(jq --arg body "$MESSAGE" -n '{body: $body}')" \
--header "authorization: Bearer $GITHUB_TOKEN" \
--header 'content-type: application/json' \
"https://api.github.com/repos/AlexRogalskiy/object-mappers-playground/issues/$number/comments"

curl -s -o /dev/null \
-X PATCH \
--data '{"state": "close"}' \
--header "authorization: Bearer $GITHUB_TOKEN" \
--header 'content-type: application/json' \
"https://api.github.com/repos/AlexRogalskiy/object-mappers-playground/pulls/$number"
done < <(curl -H "Content-Type: application/json" \
--header "authorization: Bearer $GITHUB_TOKEN" \
"https://api.github.com/search/issues?q=repo:AlexRogalskiy/object-mappers-playground+type:pr+updated:<$(date -d "-21 days" +%Y-%m-%d)+label:pending+is:open" |
jq -r '.items[] | (.number,.title)')
21 changes: 21 additions & 0 deletions .github/scripts/comment-commands/close.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/usr/bin/env bash

#doc: Close pending pull request temporary
# shellcheck disable=SC2124
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"
MESSAGE=$(cat $SCRIPT_DIR/../closing-message.txt)

set +x #GITHUB_TOKEN
curl -s -o /dev/null \
-X POST \
--data "$(jq --arg body "$MESSAGE" -n '{body: $body}')" \
--header "authorization: Bearer $GITHUB_TOKEN" \
--header 'content-type: application/json' \
"$(jq -r '.issue.comments_url' "$GITHUB_EVENT_PATH")"

curl -s -o /dev/null \
-X PATCH \
--data '{"state": "close"}' \
--header "authorization: Bearer $GITHUB_TOKEN" \
--header 'content-type: application/json' \
"$(jq -r '.issue.pull_request.url' "$GITHUB_EVENT_PATH")"
7 changes: 7 additions & 0 deletions .github/scripts/comment-commands/debug.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env bash

#doc: Show current event json to debug problems

echo "\`\`\`"
cat "$GITHUB_EVENT_PATH"
echo "\`\`\`"
13 changes: 13 additions & 0 deletions .github/scripts/comment-commands/help.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/usr/bin/env bash

#doc: Show all the available comment commands
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"
echo "Available commands:"
DOCTAG="#"
DOCTAG="${DOCTAG}doc"
for command in "$DIR"/*.sh; do
COMMAND_NAME="$(basename "$command" | sed 's/\.sh$//')"
if [ "$COMMAND_NAME" != "debug" ]; then
printf " * /**%s** %s\n" "$COMMAND_NAME" "$(grep $DOCTAG "$command" | sed "s/$DOCTAG//g")"
fi
done
11 changes: 11 additions & 0 deletions .github/scripts/comment-commands/label.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/usr/bin/env bash

#doc: add new label to the issue: `/label <label>`
LABEL="$1"
URL="$(jq -r '.issue.url' "$GITHUB_EVENT_PATH")/labels"
set +x #GITHUB_TOKEN
curl -s -o /dev/null \
-X POST \
--data "$(jq --arg value "$LABEL" -n '{labels: [ $value ]}')" \
--header "authorization: Bearer $GITHUB_TOKEN" \
"$URL"
22 changes: 22 additions & 0 deletions .github/scripts/comment-commands/pending.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/usr/bin/env bash

#doc: Add a REQUESTED_CHANGE type review to mark issue non-mergeable: `/pending <reason>`
# shellcheck disable=SC2124
MESSAGE="Marking this issue as un-mergeable as requested.
Please use \`/ready\` comment when it's resolved.
Please note that the PR will be closed after 21 days of inactivity from now. (But can be re-opened anytime later...)
> $@"

URL="$(jq -r '.issue.pull_request.url' "$GITHUB_EVENT_PATH")/reviews"
set +x #GITHUB_TOKEN
curl -s -o /dev/null \
--data "$(jq --arg body "$MESSAGE" -n '{event: "REQUEST_CHANGES", body: $body}')" \
--header "authorization: Bearer $GITHUB_TOKEN" \
--header 'content-type: application/json' \
"$URL"

curl -s -o /dev/null \
-X POST \
--data '{"labels": [ "pending" ]}' \
--header "authorization: Bearer $GITHUB_TOKEN" \
"$(jq -r '.issue.url' "$GITHUB_EVENT_PATH")/labels"
20 changes: 20 additions & 0 deletions .github/scripts/comment-commands/ready.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/usr/bin/env bash

#doc: Dismiss all the blocking reviews by github-actions bot
MESSAGE="Blocking review request is removed."
URL="$(jq -r '.issue.pull_request.url' "$GITHUB_EVENT_PATH")/reviews"
set +x #GITHUB_TOKEN
curl -s "$URL" |
jq -r '.[] | [.user.login, .id] | @tsv' |
grep github-actions |
awk '{print $2}' |
xargs -n1 -IISSUE_ID curl -s -o /dev/null \
-X PUT \
--data "$(jq --arg message "$MESSAGE" -n '{message: $message}')" \
--header "authorization: Bearer $GITHUB_TOKEN" \
"$URL"/ISSUE_ID/dismissals

curl -s -o /dev/null \
-X DELETE \
--header "authorization: Bearer $GITHUB_TOKEN" \
"$(jq -r '.issue.url' "$GITHUB_EVENT_PATH")/labels/pending"
61 changes: 61 additions & 0 deletions .github/scripts/comment-commands/retest.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
#!/usr/bin/env bash

#doc: provide help on how to trigger new CI build

# posting a new commit from this script does not trigger CI checks
# https://help.github.com/en/actions/reference/events-that-trigger-workflows#triggering-new-workflows-using-a-personal-access-token

set -eu

code='```'

pr_url="$(jq -r '.issue.pull_request.url' "${GITHUB_EVENT_PATH}")"
commenter="$(jq -r '.comment.user.login' "${GITHUB_EVENT_PATH}")"
assoc="$(jq -r '.comment.author_association' "${GITHUB_EVENT_PATH}")"

curl -LSs "${pr_url}" -o pull.tmp
source_repo="$(jq -r '.head.repo.ssh_url' pull.tmp)"
branch="$(jq -r '.head.ref' pull.tmp)"
pr_owner="$(jq -r '.head.user.login' pull.tmp)"
maintainer_can_modify="$(jq -r '.maintainer_can_modify' pull.tmp)"

# PR owner
# =>
# has local branch, can simply push
if [[ "${commenter}" == "${pr_owner}" ]]; then
cat <<-EOF
To re-run CI checks, please follow these steps with the source branch checked out:
${code}
git commit --allow-empty -m 'trigger new CI check'
git push
${code}
EOF

# member AND modification allowed by PR author
# OR
# repo owner
# =>
# include steps to fetch branch
elif [[ "${maintainer_can_modify}" == "true" ]] && [[ "${assoc}" == "MEMBER" ]] || [[ "${assoc}" == "OWNER" ]]; then
cat <<-EOF
To re-run CI checks, please follow these steps:
${code}
git fetch "${source_repo}" "${branch}"
git checkout FETCH_HEAD
git commit --allow-empty -m 'trigger new CI check'
git push "${source_repo}" HEAD:"${branch}"
${code}
EOF

# other folks
# =>
# ping author
else
cat <<-EOF
@${pr_owner} please trigger new CI check by following these steps:
${code}
git commit --allow-empty -m 'trigger new CI check'
git push
${code}
EOF
fi
41 changes: 41 additions & 0 deletions .github/scripts/process-comment.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#!/usr/bin/env bash

set +x #don't show GITHUB_TOKEN

SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"
BODY=$(jq -r .comment.body "$GITHUB_EVENT_PATH")
LINES=$(printf "%s" "$BODY" | wc -l)
if [ "$LINES" == "0" ]; then
if [[ "$BODY" == /* ]]; then
echo "Command $BODY is received"
COMMAND=$(echo "$BODY" | awk '{print $1}' | sed 's/\///')
ARGS=$(echo "$BODY" | cut -d ' ' -f2-)
if [ -f "$SCRIPT_DIR/comment-commands/$COMMAND.sh" ]; then
RESPONSE=$("$SCRIPT_DIR/comment-commands/$COMMAND.sh" "${ARGS[@]}")
EXIT_CODE=$?
if [[ $EXIT_CODE != 0 ]]; then
# shellcheck disable=SC2124
RESPONSE="> $BODY

Script execution has been failed with exit code $EXIT_CODE. Please check the output of the github action run to get more information.
\`\`\`
$RESPONSE
\`\`\`
"
fi
else
RESPONSE="No such command. \`$COMMAND\` $("$SCRIPT_DIR/comment-commands/help.sh")"
fi
if [ "$GITHUB_TOKEN" ]; then
set +x #do not display the GITHUB_TOKEN
COMMENTS_URL=$(jq -r .issue.comments_url "$GITHUB_EVENT_PATH")
curl -s \
--data "$(jq --arg body "$RESPONSE" -n '{body: $body}')" \
--header "authorization: Bearer $GITHUB_TOKEN" \
--header 'content-type: application/json' \
"$COMMENTS_URL"
else
echo "$RESPONSE"
fi
fi
fi
23 changes: 23 additions & 0 deletions .github/scripts/release-functions.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/bash

set -e
set -o errexit
set -o pipefail
set -o nounset

DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

LOCAL_VERSION=$(jq -r .http4k.version $DIR/version.json)

function create_tag {
git tag -a "$LOCAL_VERSION" -m "http4k version $LOCAL_VERSION"
git push origin "$LOCAL_VERSION"
}

function ensure_release_commit {
local CHANGED_FILES=$(git diff-tree --no-commit-id --name-only -r HEAD)

if [[ "$CHANGED_FILES" != *version.json* ]]; then
echo "Version did not change on this commit. Ignoring"; exit 0;
fi
}
13 changes: 13 additions & 0 deletions .github/workflows/add-labels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Pull Request Labeler

on:
pull_request_target:
types: [ opened ]

jobs:
triage:
runs-on: ubuntu-latest
steps:
- uses: ericcornelissen/labeler@label-based-on-status
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
41 changes: 41 additions & 0 deletions .github/workflows/changelog.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# From: https://github.com/hopsoft/stimulus_reflex/blob/master/.github/workflows/changelog.yml
name: Changelog

on:
workflow_dispatch:
release:
types: [ created ]
push:
branches:
- master

jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 4
if: "!contains(github.event.head_commit.message, '[nodoc]')"
steps:
- uses: actions/checkout@master
- name: Set up Ruby 3.0
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.0
- uses: actions/cache@v2
with:
path: vendor/bundle
key: ${{ runner.os }}-changelog-gem
restore-keys: ${{ runner.os }}-changelog-gem
- name: Create local changes
run: |
gem install github_changelog_generator
github_changelog_generator -u ${{ github.repository_owner }} -p ${{ github.event.repository.name }} --token ${{ secrets.GITHUB_TOKEN }} --exclude-labels duplicate,question,invalid,wontfix,nodoc
- name: Commit files
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Actions"
git commit -am "[nodoc] Update Changelog\n\nAdded CHANGELOG file" || echo "No changes to commit"
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}
2 changes: 1 addition & 1 deletion .github/workflows/checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ env:
LANGUAGE: "en_US:en"
JAVA_OPTS: -Xms512m -Xmx1024m
GRADLE_OPTS: >-
-Dorg.gradle.configureondemand=true -Dorg.gradle.daemon=false -Dorg.gradle.parallel=false -Dkotlin.incremental=false -Dorg.gradle.jvmargs="-Xmx3g -XX:MaxPermSize=2048m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8"
-Dorg.gradle.configureondemand=true -Dorg.gradle.daemon=false -Dorg.gradle.parallel=false -Dorg.gradle.caching=false -Dkotlin.incremental=false -Dorg.gradle.jvmargs="-Xmx3g -XX:MaxPermSize=2048m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8"

jobs:
gradle:
Expand Down
Loading
Loading