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

[IO-1554][internal] Further CI/CD tooling #680

Merged
merged 213 commits into from
Oct 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
213 commits
Select commit Hold shift + click to select a range
7277616
Marked existing as old, added new flow basics
Aug 24, 2023
c3bccbf
Bare bones of initial scripts for testing
Aug 24, 2023
1c5fcd6
Written basic shell scripts for most steps
Aug 25, 2023
98671e0
WIP
Aug 25, 2023
21846b7
Correction to scripts
Aug 25, 2023
6668eac
Script that confirms release needs doing
Aug 29, 2023
bb8d0ec
Python versioning scripts WIP
Aug 29, 2023
f17b69f
Attempt at fix for changed files filter
Aug 29, 2023
5a4aede
Bash refactor
Aug 29, 2023
413f600
Update flows
Aug 30, 2023
5111954
Fixing Bash scripts and testing
Aug 30, 2023
a338e80
Github token change
Aug 30, 2023
407e086
Moved token to use github namespace
Aug 30, 2023
ba4591f
Output list of changed files
Aug 30, 2023
ce703c2
Testing passing around variables
Aug 30, 2023
bd5873a
Changing echo types
Aug 30, 2023
4cfcaad
Trying a different approach
Aug 30, 2023
891dec4
Check gh cli version
Aug 30, 2023
467bfd3
Fix for command wrapping
Aug 30, 2023
e389a70
Setting step output
Aug 30, 2023
10cd78a
Set env var
Aug 30, 2023
93fac8e
Different approach to passing vars
Aug 30, 2023
5a79f49
Format and lint should work now
Aug 30, 2023
cce8fff
Refactor of bash scripts
Aug 31, 2023
ec1ddc5
Re-enabled testing stage
Aug 31, 2023
7283cba
Get absolute paths in bash scripts
Aug 31, 2023
611814f
Ensure poetry is installed
Aug 31, 2023
b134b7c
Updated test script
Aug 31, 2023
d11a071
Extract tests into own file for use elsewhere
Aug 31, 2023
ca152b7
Make tests.yml reusable
Aug 31, 2023
33a51ae
Improve run
Aug 31, 2023
7a313fe
Work out the issue with the poetry binary
Aug 31, 2023
5b32995
Set powershell to run in pwsh
Aug 31, 2023
ea01e15
Convert flows to reusable flows
Aug 31, 2023
998429a
Refactored yaml to call jobs from reusable workflows directly
Aug 31, 2023
14df7cd
Fixing links
Aug 31, 2023
853bb15
Two simple replacements for 3rd party tools
Aug 31, 2023
5eba13d
Use bash as shell
Sep 1, 2023
190f515
Fix variable assignment
Sep 1, 2023
da805ee
Format and lint simplification
Sep 1, 2023
5b856d9
Debugging output
Sep 1, 2023
b1cc7fb
Confirm passing of variables
Sep 1, 2023
02d8c7c
Found the alternative context
Sep 1, 2023
73c6e48
Fixed grep problem
Sep 1, 2023
67c0cf0
Doing some debugging to reduce to python files only
Sep 1, 2023
c58a785
Creation of new variables
Sep 1, 2023
05c3353
trim strings
Sep 1, 2023
a9927e7
Trying an echo for output
Sep 1, 2023
969af9a
Assign variables properly
Sep 1, 2023
46969f1
File rename and new file filtering
Sep 1, 2023
eadfc92
Correct quote
Sep 1, 2023
f21bf06
Change to piping
Sep 1, 2023
07577fc
Debugging statements
Sep 1, 2023
6e8bae5
Conditional setting of output
Sep 1, 2023
9a719e9
Testing a hypothesis
Sep 1, 2023
c399ac0
Testing which step fails
Sep 1, 2023
a0c18ec
Localising error
Sep 1, 2023
e868227
pipefail issue
Sep 1, 2023
3821874
Suppress grep errors if they occur
Sep 1, 2023
ef53b5a
Filrering should be fault tolerant now
Sep 1, 2023
8c9cc38
Github doesn't handle multiline strings well
Sep 1, 2023
ae1e8e3
File filter in python
Sep 1, 2023
2dc25d6
Make executable
Sep 1, 2023
e969ec2
Output checking
Sep 1, 2023
60802f4
Expose whole strings to see what is mutating them
Sep 4, 2023
5d4e640
Added new opportunities for debugging
Sep 4, 2023
dba2337
Checking entire context
Sep 4, 2023
a81bd71
Testing an idea
Sep 4, 2023
ef61d18
Trying a test value
Sep 4, 2023
aa6c8d7
Debug step
Sep 4, 2023
5333270
Testing something
Sep 4, 2023
9859eda
Debugging step
Sep 4, 2023
beae74f
Dump needs context
Sep 4, 2023
b58f978
Testing with xargs
Sep 4, 2023
47720e3
Trying removing the output section
Sep 4, 2023
4f934b9
Testing variable name length
Sep 4, 2023
ed1e481
View job
Sep 4, 2023
e4e34ee
Confirm set succeeds
Sep 4, 2023
e55a606
Syntax error corrected
Sep 4, 2023
52b8b6f
Correct commit
Sep 4, 2023
9b5a62e
JSON error
Sep 4, 2023
3645e65
filename
Sep 4, 2023
49b9943
Trying one last thing, and then taking a whole different approach
Sep 4, 2023
beda9c5
Correcting the issue
Sep 4, 2023
0780e45
Getting somewhere
Sep 4, 2023
e1e36b7
Restructure of directories
Sep 4, 2023
2c15fa2
Restructure again because github doesn't support nested directories
Sep 4, 2023
1f660f2
Changes to make tests work
Sep 4, 2023
d09ab37
Test runner
Sep 4, 2023
538a397
Bash changes
Sep 4, 2023
1a14c39
Lint job change
Sep 4, 2023
bdab367
Tests
Sep 4, 2023
2bb285d
Missed a shell command
Sep 4, 2023
eaa887f
Extract install deps into reusable flow for later, fix tests job
Sep 5, 2023
c2075b3
Make black formatter pass
Sep 5, 2023
e2d08fa
Final fixes to the increase version system
Sep 5, 2023
3639d9c
Merge branch 'master' into io-1554
Sep 5, 2023
9fdef65
Add in pyproject validator
Sep 5, 2023
454ee0c
increase_version now supports cicd mode
Sep 5, 2023
e289e6b
Release tag
Sep 5, 2023
52414ec
Correct install deps reusable flow
Sep 5, 2023
92633fd
Change flows to pass variables correctly
Sep 5, 2023
20ed111
Return reusable to within tests
Sep 5, 2023
14e1479
Lock file was blocking tests
Sep 5, 2023
be60008
Test fixes
Sep 5, 2023
e584cee
Addition of a debug statement to sort context
Sep 5, 2023
9b46d6c
Jobs context
Sep 5, 2023
2a868c5
Restructure linting and formatting
Sep 5, 2023
9c1944f
Get black and flake passing
Sep 5, 2023
47febf3
Extracted formatting
Sep 6, 2023
41bc6d9
Permissions
Sep 6, 2023
b58d844
Linting and format jobs
Sep 6, 2023
eac86d2
Use ruff instead of black
Sep 6, 2023
e9af68c
Bash syntax
Sep 6, 2023
361b635
Fix black
Sep 6, 2023
948cfca
Changes to increment_version.py for CICD use
Sep 7, 2023
84b15ce
Outline of all basic flows
Sep 7, 2023
60efa3c
End of PR task
Sep 7, 2023
b60ca29
Testing merge action
Sep 7, 2023
8148747
Typecheck fix
Sep 7, 2023
39f8bb1
Job name change
Sep 7, 2023
3b9c49c
PR finish
Sep 7, 2023
191eeb7
poetry install options
Sep 7, 2023
79273f4
Deps change
Sep 7, 2023
3c9bda8
Switch to an action
Sep 7, 2023
d6ebc24
config entirely in ticks
Sep 7, 2023
681c6b1
Taking mypy out of the mix for now-ticketed for return
Sep 8, 2023
aedd8fe
Merge to master documentation job
Sep 8, 2023
82325ae
Setup to test doc gen in branch
Sep 8, 2023
f72d0d0
Simulate a squash merge
Sep 8, 2023
e93ae18
Test version of reverse commit step
Sep 8, 2023
5b9cafd
Added debug statement to find the correct context member
Sep 8, 2023
e6f2ea3
Correction to flow
Sep 8, 2023
dc9a57b
Quick change to get context info
Sep 8, 2023
3468a37
Reverse commit should now get the correct branch name
Sep 8, 2023
46e011d
Remove AWS from the doc run
Sep 8, 2023
5cc1ada
Starting debug of AWS step
Sep 8, 2023
b4936a8
Test AWS auth with no upload
Sep 8, 2023
aa3a648
Enable in place
Sep 8, 2023
c5fcd78
Enable merge to master action
Sep 8, 2023
e1250db
Add permissions to scheduled release action
Sep 8, 2023
033a1f3
Enable workflow dispatch for testing
Sep 8, 2023
84828c5
Change crontab for testing
Sep 8, 2023
c99d45b
Use existing linear label updater
Sep 8, 2023
6fc04cc
Scheduled release CRON
Sep 8, 2023
e458b8f
Release process
Sep 8, 2023
64415ca
Debug check master is passing
Sep 8, 2023
83ffe0f
Making tag check test against main branch as default.
Sep 8, 2023
dcb8f56
Fixed the JS
Sep 8, 2023
fb390f6
Fixed the JS
Sep 8, 2023
447ba7a
some debugging
Sep 8, 2023
9e5acee
Get contexts for debugging
Sep 8, 2023
604e71b
Add contexts
Sep 8, 2023
3de6ad7
Correct debug
Sep 8, 2023
3725623
Some debug
Sep 8, 2023
de50d73
Correct JS
Sep 8, 2023
d6fb12c
Finding workflow runs
Sep 11, 2023
bc5f22c
Change version back
Sep 11, 2023
34777c0
Fix JS
Sep 11, 2023
23fc1b1
Retrieve workflow runs
Sep 11, 2023
1130a3b
JS correction
Sep 11, 2023
8eb383d
Trying a new approach
Sep 11, 2023
3645276
Reverse destructuring
Sep 11, 2023
06be44e
Used different approach
Sep 11, 2023
7b107c9
Release path changes
Sep 11, 2023
ecc1abd
Add name to step
Sep 11, 2023
25d3e96
Removed clutter
Sep 12, 2023
f2a4237
Release refactor
Sep 12, 2023
efedae6
Added a codeowners file
Sep 12, 2023
478c71f
Update to CODEOWNERS file
Sep 12, 2023
64da97d
Release draft system
Sep 12, 2023
9476640
One step deploy script
Sep 12, 2023
437002a
Remove old code
Sep 12, 2023
67b4604
Slack message sender
Sep 13, 2023
a9bd8ae
Release use slack action
Sep 13, 2023
1f91c62
Release process document
Sep 13, 2023
41dfe02
Merge branch 'master' into io-1554
Sep 13, 2023
fc7d478
Remove the testmerge file
Sep 13, 2023
b7a57e4
Fully enable merge-to-master behaviour
Sep 13, 2023
f7d702a
Set success on master merge action
Sep 13, 2023
7babb93
Ticket moving script
Sep 18, 2023
078a57c
WIP
Sep 19, 2023
edf04f2
Merge branch 'master' into io-1554
Sep 19, 2023
a3525bd
Placeholder in ticket
Sep 26, 2023
f1de353
Merge in master
Sep 28, 2023
aade733
WIP, close to done
Sep 29, 2023
c158130
Merge branch 'master' into io-1554
owencjones Oct 1, 2023
f7f79e0
Unify master e2e dir with branch
Oct 1, 2023
98fb564
Implementation of slack messaging
Oct 1, 2023
c3fff3e
Getting typecheck working in PR flow
Oct 2, 2023
d7184e4
Improvement to bash syntax practices
Oct 2, 2023
291101c
Testing with a python file in place
Oct 2, 2023
1e61750
Don't run if we shouldn't.
Oct 2, 2023
48008eb
Remove unnecessary section in typecheck
Oct 2, 2023
1ea97e3
Rework
Oct 2, 2023
50aa3ec
Some sensible changes to get jobs to run
Oct 2, 2023
ea412af
Got back to recreating the mypy error
Oct 2, 2023
0ea8888
Dependency fix attempt
Oct 2, 2023
8df485b
Removing testing file
Oct 2, 2023
610f6f3
Updating reverse commit
Oct 3, 2023
a1ce749
PR Comments
Oct 3, 2023
3e9ebc6
[IO-1754] Darwin-py v2 Dogfooding refactors (#670)
Nathanjp91 Oct 1, 2023
9ffa420
HOTFIX: Documentation fix
Oct 1, 2023
1840d4f
[IO-1824][internal] Documentation fix (#673)
owencjones Oct 2, 2023
445981d
[IO-1561] Mypy cleanup (#652)
Nathanjp91 Oct 3, 2023
2daeae9
HOUSEKEEPING: Bump version to 0.8.43
Oct 3, 2023
8915a7f
[IO-1829] Tests refactor and timing changes (#676)
Nathanjp91 Oct 3, 2023
b6d7c64
[IO-1661][external] Error messages were not clear to customers (#674)
owencjones Oct 3, 2023
7586e1e
HOUSEKEEPING: Bump version to v0.8.44
Oct 10, 2023
763b377
Fixed conflicts
Oct 10, 2023
c22f216
Merge master
Oct 10, 2023
40e05c5
Merge branch 'io-1659' into io-1554
Oct 10, 2023
502d28b
Merge branch 'master' into io-1554
Oct 10, 2023
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
14 changes: 7 additions & 7 deletions .github/workflows/EVENT_pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,15 @@ jobs:
with:
files: ${{ needs.get_changed_files.outputs.python_changed_files }}

# TODO: See Issue IO-1666
# typecheck:
# name: Analyse types in python
# needs: get_changed_files
# uses: ./.github/workflows/JOB_typecheck.yml
# with:
# files: ${{ needs.get_changed_files.outputs.python_changed_files }}
typecheck:
name: Analyse types in python
needs: get_changed_files
uses: ./.github/workflows/JOB_typecheck.yml
with:
files: ${{ needs.get_changed_files.outputs.python_changed_files }}

run_tests:
needs: [format, lint, typecheck]
name: Run tests
uses: ./.github/workflows/JOB_tests.yml

5 changes: 5 additions & 0 deletions .github/workflows/JOB_format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ on:

jobs:
format:
if: ${{ inputs.files != '' }}
runs-on: ubuntu-latest
steps:
- name: Check out source repository
Expand All @@ -21,6 +22,10 @@ jobs:
with:
python-version: "3.11"

- name: Show filenames
run: echo ${{ inputs.files }}

- name: Black check
shell: bash
run: bash ${{ github.workspace }}/deploy/format_lint.sh format ${{ inputs.files }}

7 changes: 6 additions & 1 deletion .github/workflows/JOB_lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ on:

jobs:
lint:
if: ${{ inputs.files != '' }}
runs-on: ubuntu-latest
steps:
- name: Check out source repository
Expand All @@ -21,6 +22,10 @@ jobs:
with:
python-version: "3.10"

- name: flake8 Lint
- name: Show filenames
run: echo ${{ inputs.files }}

- name: Ruff Lint
shell: bash
run: bash ${{ github.workspace }}/deploy/format_lint.sh lint ${{ inputs.files }}

13 changes: 7 additions & 6 deletions .github/workflows/JOB_typecheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ on:

jobs:
typecheck:
if: ${{ inputs.files != '' }}
runs-on: ubuntu-latest
steps:
- name: Check out source repository
Expand All @@ -21,12 +22,12 @@ jobs:
with:
python-version: "3.10"

- name: Install dependencies
shell: bash
run: |
pip install poetry
poetry install install --all-extras -vvv --no-root
- name: Show filenames
run: echo ${{ inputs.files }}

- name: MyPy typecheck
shell: bash
run: bash ${{ github.workspace }}/deploy/format_lint.sh typecheck ${{ inputs.files }}
run: |
pip install pydantic
bash ${{ github.workspace }}/deploy/format_lint.sh typecheck ${{ inputs.files }}

100 changes: 51 additions & 49 deletions deploy/format_lint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

ACTION=$1
shift 1
FILES=$@
FILES=$*

echo "Action: $ACTION"
echo "Files: $FILES"
Expand All @@ -20,84 +20,86 @@ if [[ -z $FILES ]]; then
fi

# Install dependencies
pipinstall() {
if ! pip install "$@" &> pip_log.txt; then
echo "Pip install failed"
cat pip_log.txt
rm pip_log.txt
exit 1
fi
}

if [ "$ACTION" == "format" ]; then
pip install black &> pip_log.txt
pipinstall black
elif [ "$ACTION" == "lint" ]; then
pip install ruff &> pip_log.txt
pipinstall ruff
elif [ "$ACTION" == "typecheck" ]; then
pip install mypy &> pip_log.txt
pipinstall mypy
else
echo "Action must be format, typecheck, or lint"
exit 1
fi

# Check if pip install failed
if [ $? -ne 0 ]; then
echo "Pip install failed"
cat pip_log.txt
rm pip_log.txt
exit 1
fi

failed_files=""
echo "** Checking files [$FILES] **"

for file in $FILES ; do

if [[ ! -f $file ]]; then
echo
echo "📁 Skipping file $file, file doesn't exist. Was probably removed in PR diff."
continue
fi

echo "_________________________________________________________"
echo
echo "Checking $file"

if [ -f $file ]; then
if [ "$ACTION" == "lint" ]; then
ruff check $FILES; rc=$?
echo "$rc"
if [ $rc -ne 0 ]; then
failed_files="$failed_files $file"
echo "❌"
else
echo "✅"
fi


if [ "$ACTION" == "lint" ]; then

if ! ruff check "$file"; then
failed_files="$failed_files $file"
echo "❌"
else
echo "✅"
fi

if [ "$ACTION" == "typecheck" ]; then
mypy $file
if [ $? -ne 0 ]; then
failed_files="$failed_files $file"
echo "❌"
else
echo "✅"
fi
fi

if [ "$ACTION" == "typecheck" ]; then

if ! mypy "$file"; then
failed_files="$failed_files $file"
echo "❌"
else
echo "✅"
fi

if [ "$ACTION" == "format" ]; then
black --check $file
if [ $? -ne 0 ]; then
failed_files="$failed_files $file"
echo "❌"
else
echo "✅"
fi
fi

if [ "$ACTION" == "format" ]; then

if ! black --check "$file"; then
failed_files="$failed_files $file"
echo "❌"
else
echo "✅"
fi
else
echo "File $file does not exist"
fi

echo "DEBUG"
echo "failed_files: $failed_files"


echo "_________________________________________________________"
done

echo
echo

if [[ "$failed_files" != "" ]]; then
echo "Checks failed for $failed_formatting files 😢"
echo "Checks failed for $failed_files files 😢"
echo "Failed files"
for file in $failed_files ; do
echo "- $file"
done
exit 1
else
echo "Formatting passed for all files 🎉"
echo "$ACTION passed for all files 🎉"
fi
exit 0
Loading