Skip to content
Merged
Show file tree
Hide file tree
Changes from 131 commits
Commits
Show all changes
255 commits
Select commit Hold shift + click to select a range
85c279a
run update_upstream_versions in tests
ytausch Aug 26, 2024
7ec1130
gather feedstocks in tests + make graph
ytausch Aug 26, 2024
14d95ec
update upstream versions in tests
ytausch Aug 30, 2024
6c6df63
add other make-graph step
ytausch Aug 30, 2024
c0bb8bf
enable debugging, deploy, don't update pinnings every time
ytausch Aug 30, 2024
bff923f
refactor and fix env vars
ytausch Aug 30, 2024
a34e0dd
add pydantic feedstock as a resource
ytausch Aug 30, 2024
6a50924
add IntegrationTestHelper supporting overwriting feedstock contents
ytausch Aug 30, 2024
3349115
Merge branch 'main' into integration-tests
ytausch Dec 5, 2024
ac251e2
relock, fix install bot code
ytausch Dec 5, 2024
559da82
fix subprocess call
ytausch Dec 5, 2024
dfbf795
set git initial branch
ytausch Dec 5, 2024
fcac4ca
fix tests
ytausch Dec 5, 2024
ddfe29b
set proxy in update-upstream-versions
ytausch Dec 5, 2024
c478c2d
global router + overwrite cf-graph repo
ytausch Dec 5, 2024
c65ce89
reorder steps
ytausch Dec 5, 2024
aa2b8d5
fix install bot code
ytausch Dec 5, 2024
95d47eb
disable random skipping in integration tests
ytausch Dec 5, 2024
4724945
use correct env name for container image
ytausch Dec 5, 2024
d6b5a66
(todo) don't overwrite container image env variables
ytausch Dec 5, 2024
9fc744a
reorder action steps
ytausch Dec 5, 2024
ee50def
fix
ytausch Dec 5, 2024
7d19a53
don't create pinning repo
ytausch Dec 5, 2024
84a5060
debug
ytausch Dec 5, 2024
8479a8d
fix
ytausch Dec 5, 2024
b3c2a83
debug
ytausch Dec 5, 2024
9e15297
debug
ytausch Dec 5, 2024
1d0eaba
also capture stderr
ytausch Dec 5, 2024
4b28a43
use older version for pydantic
ytausch Dec 5, 2024
289fb55
use lowercase proxy
ytausch Dec 5, 2024
2417f74
set DEPLOY_REPO correctly
ytausch Dec 5, 2024
0cbb33c
tmate action
ytausch Dec 6, 2024
255d203
dont use proxy for tmate
ytausch Dec 6, 2024
22f23ff
fix
ytausch Dec 6, 2024
3a5aacf
fix proxy in container
ytausch Dec 6, 2024
65b18ab
fix
ytausch Dec 6, 2024
a1d0ad3
git CLI: don't use proxy
ytausch Dec 6, 2024
39973c5
add make-migrators step
ytausch Dec 6, 2024
5939a01
fix
ytausch Dec 6, 2024
f3c91a5
Merge branch 'main' into integration-tests
ytausch Dec 6, 2024
5dc39a7
relock
ytausch Dec 6, 2024
9fafb3f
don't use with sensitive_env
ytausch Dec 6, 2024
7ec0e1f
fix
ytausch Dec 6, 2024
c8ade5a
fix
ytausch Dec 6, 2024
d1f213a
make GitHub API transparent
ytausch Dec 6, 2024
9d8a0f7
install_bot_code does not need BOT_TOKEN
ytausch Dec 6, 2024
d9f91ee
separate bot user token and regro org token
ytausch Dec 6, 2024
56f9caa
Merge branch 'separate-bot-tokens' into integration-tests
ytausch Dec 6, 2024
2ca2b70
apply fixes
ytausch Dec 6, 2024
63fec86
Merge branch 'separate-bot-tokens' into integration-tests
ytausch Dec 6, 2024
2023229
relock
ytausch Dec 6, 2024
395bbd8
fix token
ytausch Dec 6, 2024
541b314
fix URL request handler
ytausch Dec 8, 2024
52a37f5
fix URL request handler
ytausch Dec 8, 2024
0ee5e35
Revert "Merge branch 'separate-bot-tokens' into integration-tests"
ytausch Dec 9, 2024
8394322
Revert "Merge branch 'separate-bot-tokens' into integration-tests"
ytausch Dec 9, 2024
c1e2e9b
use classic PAT
ytausch Dec 9, 2024
47f4959
remove tmate
ytausch Dec 9, 2024
44a9a1f
use TEST_SETUP_TOKEN
ytausch Dec 9, 2024
067b397
fix: forward headers
ytausch Dec 9, 2024
0dc16ea
fix proxy
ytausch Dec 9, 2024
9e5351c
make PyPI tarfiles transparent
ytausch Dec 9, 2024
b3c9073
route transparent URLs directly by mitmproxy, configure conda-forge org
ytausch Dec 16, 2024
04284a2
use conda-forge-bot-staging everywhere
ytausch Dec 16, 2024
320c71c
fix setup
ytausch Dec 16, 2024
9684e4d
add llvmdev via submodule
ytausch Dec 16, 2024
a028330
add pydantic via submodule
ytausch Dec 16, 2024
2dce94b
run make-migrators twice
ytausch Dec 16, 2024
2959dc9
successfully validate new pydantic version
ytausch Dec 16, 2024
dc93669
remove llvmdev from integration tests
ytausch Jan 7, 2025
5a122fe
Merge remote-tracking branch 'origin/main' into integration-tests
ytausch Jan 8, 2025
1b014ae
Merge branch 'main' into integration-tests
ytausch Jan 8, 2025
c3f767b
relock
ytausch Jan 8, 2025
3f7d5b5
fix conda forge org override
ytausch Jan 8, 2025
f3b051e
fix typo
ytausch Jan 8, 2025
7ad4547
fix todo: override env variables in install_bot_code.sh
ytausch Jan 8, 2025
1f9f742
fix: don't divide by zero
ytausch Jan 8, 2025
0fe9280
Merge branch 'fix-divide-by-zero' into integration-tests
ytausch Jan 8, 2025
cc5a57e
finish docs for integration testing
ytausch Jan 8, 2025
8b8ab07
docs: refer to TRANSPARENT_URLs
ytausch Jan 8, 2025
973d95c
try to run make-migrators a third time
ytausch Jan 8, 2025
db1d975
review: fix branch name
ytausch Jan 14, 2025
8c8cf3d
pin GitHub Actions correctly
ytausch Jan 14, 2025
d9a2aa3
fix: we don't want to change num_try
ytausch Jan 14, 2025
43e69ed
fix: use CONDA_FORGE_ORG
ytausch Jan 14, 2025
f6d4164
move ENV_OVERRIDE_CONDA_FORGE_ORG to settings.py
ytausch Jan 14, 2025
1c0ed33
use debug log level if running workflow in debug mode
ytausch Jan 14, 2025
ad43124
Merge remote-tracking branch 'origin/main' into integration-tests
ytausch Jan 14, 2025
c2e4ea1
refactor: move env variable name to constant
ytausch Jan 14, 2025
f6f63b6
DRY: use identical env variable for cf-graph repository
ytausch Jan 14, 2025
e4b7c7c
Revert "try to run make-migrators a third time"
ytausch Jan 14, 2025
4a98416
docs: fix reference to env variables
ytausch Jan 14, 2025
2def52f
use Docker image name consistently
ytausch Jan 14, 2025
3298b88
refactor: rename DEPLOY_REPO to GRAPH_REPO
ytausch Jan 14, 2025
4961401
fix f-string
ytausch Jan 14, 2025
e9c848c
clarify bug comment
ytausch Jan 14, 2025
96b7a96
move RANDOM_FRAC_TO_UPDATE to settings
ytausch Jan 14, 2025
320328d
resolve TODO
ytausch Jan 14, 2025
285663d
fix docstring
ytausch Jan 14, 2025
8b4ea6b
fix: reorder try clause
ytausch Jan 14, 2025
0a3d8d1
Merge remote-tracking branch 'origin/main' into integration-tests
ytausch Jan 14, 2025
538e50b
fix: add pip install
ytausch Jan 14, 2025
c6a67db
fix: move imports to top-level
ytausch Jan 14, 2025
d60d8b8
add debug logging to proxy
ytausch Jan 14, 2025
2d78cd6
add CODEOWNERS file to automatically request further reviews
ytausch Jan 14, 2025
334d02d
add CODEOWNERS file
ytausch Jan 14, 2025
6845d98
fix: push 1.x branch to pydantic feedstock
ytausch Jan 14, 2025
4bfc63c
Merge remote-tracking branch 'origin/main' into integration-tests
ytausch Jan 20, 2025
aafed46
Merge remote-tracking branch 'origin/main' into integration-tests
ytausch Jan 27, 2025
9e09dbc
relock
ytausch Jan 27, 2025
a72eb37
move proxy mode to conda-forge-feedstock-ops
ytausch Jan 27, 2025
e6ebafc
fix reponses from PyPI API
ytausch Jan 27, 2025
ade2668
retrigger ci
ytausch Feb 7, 2025
5877395
Merge remote-tracking branch 'origin/main' into integration-tests
ytausch Feb 7, 2025
ef432e7
ruff
ytausch Feb 7, 2025
c9c45c4
run integration tests in merge queue
ytausch Feb 7, 2025
cacf8a7
add dummy check for setup-repositories
ytausch Feb 7, 2025
eae1330
run integration tests on PRs from branches
ytausch Feb 8, 2025
148a4a6
remove dummy workflow
ytausch Feb 8, 2025
f1ec5b0
skip on push
ytausch Feb 8, 2025
4fedcf7
review suggestion: reformat
ytausch Feb 8, 2025
867a371
Apply suggestions from code review
ytausch Feb 8, 2025
7fe21f5
separate RANDOM_FRAC_TO_UPDATE for make-graph and update-upstream-ver…
ytausch Feb 9, 2025
6f7b23d
fix comment
ytausch Feb 9, 2025
593a1b9
Merge branch 'main' into integration-tests
beckermr Feb 9, 2025
551bcda
Merge branch 'main' into integration-tests
beckermr Feb 11, 2025
909a5d4
add docstring for settings.py
ytausch Feb 14, 2025
318975c
add type annotations for settings
ytausch Feb 14, 2025
5090805
prevent duplicate kwarg errors
ytausch Feb 14, 2025
c9f52e2
use deferred log expressions
ytausch Feb 14, 2025
ea9f919
clarify mimicked ClonedFeedstockContext warning
ytausch Feb 14, 2025
7b24fa6
remove "environment variables" comment again
ytausch Feb 14, 2025
7535b95
make graph repo default branch configurable
ytausch Feb 14, 2025
fb162b2
defer log expression
ytausch Feb 14, 2025
0d84983
add comment about GITHUB_OUTPUT
ytausch Feb 14, 2025
026fca2
use working-directory instead of cd
ytausch Feb 14, 2025
cbd19ec
fix env var
ytausch Feb 14, 2025
23aa196
clarify docstring
ytausch Feb 14, 2025
3bea225
docs: random.shuffle is in-place
ytausch Feb 14, 2025
3e210d0
add docs to explain test scenario collection
ytausch Feb 14, 2025
ab6e016
fix images
ytausch Feb 14, 2025
41c461e
fix except AttributeError
ytausch Feb 14, 2025
abe3ef3
add shebang
ytausch Feb 14, 2025
2323b89
Update tests_integration/resources/empty-graph/README.md
ytausch Feb 14, 2025
ea48c90
docs: clarify arbitrary test case name
ytausch Feb 14, 2025
3bc5f22
Merge remote-tracking branch 'origin/main' into integration-tests
ytausch Feb 14, 2025
b7694f2
docs: improve wording wro test scenario
ytausch Feb 17, 2025
2487529
begin refactor integration tests to pytest
ytausch Feb 21, 2025
fa0365a
continue refactor integration tests to pytest
ytausch Feb 21, 2025
8c9bc7b
update submodule
ytausch Feb 25, 2025
143d5f3
document mitmproxy
ytausch Mar 4, 2025
6d7d408
Merge remote-tracking branch 'origin/main' into integration-tests
ytausch Mar 4, 2025
56f0879
migrate to xprocess for mitmproxy
ytausch Mar 4, 2025
caa469a
make dir switches benign
ytausch Mar 4, 2025
456ad43
edit gitignore
ytausch Mar 4, 2025
60988a6
Merge remote-tracking branch 'origin/main' into integration-tests
ytausch Mar 24, 2025
612bcb6
make integration tests pass
ytausch Mar 24, 2025
e760886
Merge branch 'settings-object' into integration-tests
ytausch Mar 27, 2025
fe67d68
Merge remote-tracking branch 'origin/main' into integration-tests
ytausch Mar 27, 2025
32d0eae
chore: relock
ytausch Mar 27, 2025
3386c4f
fix: adjust for new settings module
ytausch Mar 27, 2025
e4aeacb
feat: add mitmproxy cert wizard, move mitmproxy dir
ytausch Mar 27, 2025
1ae06cb
docs: update docs for integration tests
ytausch Mar 27, 2025
de95298
feat: run new test concept everywhere
ytausch Mar 27, 2025
6b198c3
chore: disable Docker caching
ytausch Mar 27, 2025
029d289
fix: condarc file in CI
ytausch Mar 27, 2025
f0c6d91
fix: ci-driven development
ytausch Mar 27, 2025
5f819c4
fix: heredoc
ytausch Mar 27, 2025
6e146df
ci: fix script path
ytausch Mar 27, 2025
8cc21ca
ci: debug
ytausch Mar 28, 2025
658e82c
fix: trust script and ci
ytausch Mar 28, 2025
0a86e19
ci: disable debug mode
ytausch Mar 28, 2025
f8e64ba
fix: set git identity in integration tests
ytausch Mar 28, 2025
7f5da5b
debug ci
ytausch Mar 28, 2025
36f8164
fix: do proxy alive check via port probing
ytausch Mar 28, 2025
2060cb2
debug ci
ytausch Mar 28, 2025
1112ce8
fix: pass PYTHONPATH to proxy script
ytausch Mar 28, 2025
ab85166
ci: enable debug mode
ytausch Mar 28, 2025
75606d5
ci: output proxy logs
ytausch Mar 28, 2025
8b42b44
chore: formatting
ytausch Mar 28, 2025
c84e29c
debug ci
ytausch Mar 28, 2025
f89f403
debug: more timeout
ytausch Mar 28, 2025
e30d987
Merge remote-tracking branch 'origin/main' into integration-tests
ytausch Mar 30, 2025
0cb9d68
ci: debug ci with updated dependencies
ytausch Mar 30, 2025
14e6884
test(integration): don't run deploy to github in proxy env
ytausch Mar 30, 2025
6c5967e
ci debug
ytausch Mar 30, 2025
6ed2c1a
test(integration): trust crt file
ytausch Mar 30, 2025
58a5b95
ci: debug ci
ytausch Mar 30, 2025
f8c3095
chore: add mitmproxy trust script to gitignore
ytausch Mar 30, 2025
7d725cf
fix(integration-tests): add more URLs to transparent URLs
ytausch Mar 30, 2025
47cf495
Merge remote-tracking branch 'origin/main' into integration-tests
ytausch Mar 30, 2025
81d166a
chore: relock conda
ytausch Mar 30, 2025
13776aa
fix: don't reassign os.environ
ytausch Mar 30, 2025
933bec9
fix(integration tests): we also need the http versions of the transpa…
ytausch Mar 30, 2025
b478bc6
fix: typo in integration tests, pytest nodist
ytausch Mar 30, 2025
58c4387
complete integration tests
ytausch Mar 30, 2025
ed83329
ci: debug
ytausch Mar 31, 2025
a66f91c
fix: add CA cert to git
ytausch Mar 31, 2025
2a0c56a
docs: add comment for Python 3.13
ytausch Mar 31, 2025
dd6f498
remove debugger
ytausch Mar 31, 2025
bf1a54e
Merge remote-tracking branch 'origin/main' into integration-tests
ytausch Mar 31, 2025
e3634bd
chore: relock
ytausch Mar 31, 2025
93b3ccb
chore: add conda-lock to .gitattributes
ytausch Mar 31, 2025
481fb9f
Merge remote-tracking branch 'origin/main' into integration-tests
ytausch Mar 31, 2025
ec8b193
feat(integration tests): dynamically parametrize tests
ytausch Mar 31, 2025
a91a76a
docs(integration-tests): update graphics
ytausch Mar 31, 2025
305a6c0
chore: remove explicit truststore dependency
ytausch Mar 31, 2025
c52ef43
docs(integration-tests): add --dist=no flag to pytest
ytausch Mar 31, 2025
139b698
chore: remove clear runner script
ytausch Mar 31, 2025
0bf6595
chore: add original draw.io file
ytausch Mar 31, 2025
591900f
fix: typo
ytausch Mar 31, 2025
d6685e1
fix: formatting
ytausch Mar 31, 2025
1267620
fix: spelling
ytausch Mar 31, 2025
96da00b
fix: remove pydantic-settings note
ytausch Mar 31, 2025
13d579f
feat: improve instructions in setup wizard
ytausch Mar 31, 2025
e75385f
fix: formatting
ytausch Mar 31, 2025
56e8afe
docs: add note about cloning depth
ytausch Mar 31, 2025
6fc2898
rename home_directory to initial_working_dir
ytausch May 2, 2025
d2afa6f
fix: dir link
ytausch May 2, 2025
2630652
fix: get_test_scenario
ytausch May 2, 2025
d9fce89
docs: explain PyCharm warning
ytausch May 2, 2025
e61bb2d
docs: clarify lifetime of TestCase objects
ytausch May 2, 2025
7e65060
docs: refer to README in module docstring
ytausch May 2, 2025
cd1007c
refactor: use monkeypatch.setenv everywhere
ytausch May 2, 2025
5dd850d
docs: add docstring to test_scenario
ytausch May 2, 2025
c30fc7f
Merge remote-tracking branch 'origin/main' into integration-tests
ytausch May 2, 2025
d712b05
refactor: make coherent lib module for integration testing
ytausch May 2, 2025
308625a
fix: you cannot monkeypatch in module level
ytausch May 2, 2025
f291758
fix: imports
ytausch May 2, 2025
f645daf
fix: circular imports
ytausch May 5, 2025
676324e
fix method call
ytausch May 6, 2025
54e0114
fix filesystem path
ytausch May 6, 2025
f0992c3
relock w/ conda-lock
regro-cf-autotick-bot May 9, 2025
964fe3c
Merge branch 'main' into integration-tests
beckermr May 9, 2025
a3ed077
relock w/ conda-lock
regro-cf-autotick-bot May 9, 2025
70f8e28
fix integration test 1
ytausch May 9, 2025
c83192f
relock
ytausch May 12, 2025
ec7c5c5
Merge remote-tracking branch 'origin/main' into integration-tests
ytausch May 12, 2025
e755d98
fix: lower pin for conda_forge_feedstock_ops
ytausch May 12, 2025
eb708b0
relock w/ conda-lock
regro-cf-autotick-bot May 14, 2025
68f161b
relock
ytausch May 15, 2025
d901c5c
Merge remote-tracking branch 'origin/main' into integration-tests
ytausch May 15, 2025
f2c89b1
replace svg with markdown
ytausch May 15, 2025
affd038
Merge remote-tracking branch 'origin/main' into integration-tests
ytausch May 22, 2025
36f732d
hotfix: pass settings env manually
ytausch May 22, 2025
cd36ae0
fix: base_url setting
ytausch May 22, 2025
912b97d
slahes in URLs are a good thing
ytausch May 22, 2025
06ca28a
Merge remote-tracking branch 'origin/main' into integration-tests
ytausch May 22, 2025
87dd13e
run ruff
ytausch May 23, 2025
98ec78d
Merge branch 'main' into integration-tests
ytausch May 23, 2025
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
3 changes: 3 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
docs/
tests/
tests_integration/
10 changes: 10 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.github/workflows/test-integration.yml @ytausch
conda_forge_tick/contexts.py @ytausch
conda_forge_tick/git_utils.py @ytausch
conda_forge_tick/models/* @ytausch
tests/github_api/* @ytausch
tests/conda_forge_tick/* @ytausch
tests/model/* @ytausch
tests/test_contexts.py @ytausch
tests/test_git_utils.py @ytausch
tests_integration/* @ytausch
319 changes: 319 additions & 0 deletions .github/workflows/test-integration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,319 @@
name: Integration Tests
on:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No push trigger?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we add a push trigger (for main you mean?), we have even more integration test runs that block each other. Since every push to main should happen through the merge queue anyway, I don't see an advantage of adding a push trigger here.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only asking because we do have it in tests.yml. Maybe it's redundant there? @beckermr

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We do bypass the merge queue sometimes, but that is after the integration tests run on the PR, so this should be fine.

pull_request:
branches:
- main
merge_group: null


# Integration tests interact with GitHub resources in the integration test infrastructure and therefore
# cannot run concurrently with other integration tests.
concurrency:
group: cf-scripts-integration-tests
cancel-in-progress: false

defaults:
run:
shell: bash -leo pipefail {0}

env:
# Test Instrumentation
# Note: This passes secrets to steps that don't need them.
# We would not do this in a production setting.
BOT_TOKEN: ${{ secrets.GH_TOKEN_STAGING_BOT_USER }}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep I'd rather set this in each step individually. No need to overprovision.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The reason for this is as follows: I once dug deeper into the question which steps of the bot need BOT_TOKEN and which do not, using the production workflows as a first reference. I found the situation to be very messy as not every step that pretends to need BOT_TOKEN actually needs it (to name 2 examples: install_bot_code.sh, and also make-mappings IIRC).

In an ideal world, this would be clearly documented for each job. Here, I did not want to make the problem worse by creating the impression that some jobs need BOT_TOKEN and others do not, while in reality I haven't verified this is actually the case. So I just added it globally to all jobs.

In a separate PR, we should definitely clean this up. Added to my to-do list.

# Bot
CF_TICK_OVERRIDE_CONDA_FORGE_ORG: conda-forge-bot-staging
CF_TICK_GRAPH_DATA_BACKENDS: file
CF_FEEDSTOCK_OPS_CONTAINER_NAME: conda-forge-tick
CF_FEEDSTOCK_OPS_CONTAINER_TAG: test
# Deploy to GitHub step
CF_TICK_GRAPH_GITHUB_BACKEND_REPO: regro-staging/cf-graph-countyfair # also used in the "Install Bot Code" step
RUN_URL: "https://github.com/regro/cf-scripts/actions/runs/${{ github.run_id }}"

jobs:
setup-repositories:
name: Set up Integration Tests
# if triggered by pull_request, only run on non-fork PRs (secrets access needed)
# Nevertheless, this check is always run in the merge queue.
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository
runs-on: ubuntu-latest
outputs:
scenario_ids: ${{ steps.setup_repositories.outputs.scenario_ids }}
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
path: cf-scripts

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@6524bf65af31da8d45b59e8c27de4bd072b392f5 # v3.8.0

- name: Build Docker Image
uses: docker/build-push-action@b32b51a8eda65d6793cd0494a773d4f6bcef32dc # v6.11.0
with:
context: cf-scripts
push: false
load: true
tags: conda-forge-tick:test
cache-from: type=gha
cache-to: type=gha,mode=max
outputs: type=docker,dest=/tmp/image.tar

- name: Upload Docker Image
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
with:
name: conda-forge-tick
path: /tmp/image.tar

- name: setup-micromamba
uses: mamba-org/setup-micromamba@4b9113af4fba0e9e1124b252dd6497a419e7396d # v1.11.0
with:
environment-file: cf-scripts/conda-lock.yml
environment-name: cf-scripts
condarc-file: cf-scripts/autotick-bot/condarc

- name: Run pip install
run: |
cd cf-scripts
pip install --no-deps --no-build-isolation -e .

- name: Set up Integration Test Repositories
id: setup_repositories
run: |
cd cf-scripts
python -m tests_integration.setup_repositories
env:
TEST_SETUP_TOKEN: ${{ secrets.GH_TOKEN_STAGING_BOT_USER }}

run-test-scenario:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This job has a lot of sequential steps that require cleanup in between. Wouldn't separate (maybe parallel) jobs be better suited for this? Or are we trying to reduce the setup overhead?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Parallel does not work, because we need to run the steps of a scenario sequentially and we cannot execute scenarios in parallel. Not separating into different jobs is mainly about setup overhead: reinstalling is very quick, whilst "Download Docker Image" and "setup-micromamba" are slower:

image
image

Even with pixi, we could only get rid of the slow setup-micromamba times; reducing the overhead for "Download Docker Image" would require us to optimize the image.

Additionally, I am not sure how to deal with the scenarios executed as a job matrix. I'd fear it might be complicated or impossible to execute a group of jobs sequentially with a matrix.

name: Run Scenarios
# if triggered by pull_request, only run on non-fork PRs (secrets access needed)
# Nevertheless, this check is always run in the merge queue.
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository
runs-on: ubuntu-latest
needs: setup-repositories
strategy:
matrix:
scenario_id: ${{ fromJson(needs.setup-repositories.outputs.scenario_ids) }}
max-parallel: 1
fail-fast: false
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
path: cf-scripts
submodules: 'true'

- name: Download Docker Image
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: conda-forge-tick
path: /tmp

- name: setup-micromamba
uses: mamba-org/setup-micromamba@4b9113af4fba0e9e1124b252dd6497a419e7396d # v1.11.0
with:
environment-file: cf-scripts/conda-lock.yml
environment-name: cf-scripts
condarc-file: cf-scripts/autotick-bot/condarc

- name: Install Bot Code (no graph clone)
run: |
# this is the first time, so we clean disk space, but don't clone the graph
source cf-scripts/autotick-bot/install_bot_code.sh --no-pull-container --no-clone-graph

- name: Load Docker Image
run: |
docker load --input /tmp/image.tar
docker image ls -a

- name: Prepare Scenario
run: |
cd cf-scripts
python -m tests_integration.step_prepare # this creates the cf-graph repository
env:
SCENARIO_ID: ${{ matrix.scenario_id }}
TEST_SETUP_TOKEN: ${{ secrets.GH_TOKEN_STAGING_BOT_USER }}

- name: Install Bot Code
run: |
source cf-scripts/autotick-bot/install_bot_code.sh --no-pull-container --no-clean-disk-space

- name: Start HTTP Proxy
run: |
cd cf-scripts
./tests_integration/mock_proxy_start.sh &
sleep 10
# Install CA Certificate
sudo wget -e use_proxy=yes -e http_proxy=127.0.0.1:8080 -O /usr/local/share/ca-certificates/mitmproxy.crt \
http://mitm.it/cert/pem
sudo update-ca-certificates
env:
SCENARIO_ID: ${{ matrix.scenario_id }}
PYTHONPATH: ${{ github.workspace }}/cf-scripts

- name: "[Test] Gather all Feedstocks"
run: |
cd cf-graph
# don't use proxy for git CLI operations (applies to all further steps)
git config --global http."https://github.com".proxy ""
conda-forge-tick --debug gather-all-feedstocks

- name: "[Test] Deploy to GitHub"
run: |
cd cf-graph
conda-forge-tick --debug deploy-to-github

- name: Reinstall Bot Code
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are these reinstalls needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The individual steps interact with the cf-graph and conda-forge-pinning-feedstock repositories. For cf-graph, we explicitly want to test that bot steps communicate with each other via the cf-graph GitHub repository and not via some weird local state of the filesystem. Therefore, we discard cf-graph (and conda-forge-pinning-feedstock) in between steps.

For example, we don't want to forgive the bot if it forgets to push changes to GitHub and changes are only visible in the local clone.

Therefore, the reinstall clears up the runner and thus needs to "install" the bot again, i.e., clone the repositories again.

run: |
source cf-scripts/tests_integration/clear_runner.sh
source cf-scripts/autotick-bot/install_bot_code.sh --no-clean-disk-space --no-pull-container

- name: "[Test] Make Graph (Nodes and Edges)"
run: |
cd cf-graph
conda-forge-tick --debug make-graph --update-nodes-and-edges

- name: "[Test] Deploy to GitHub"
run: |
cd cf-graph
conda-forge-tick --debug deploy-to-github

- name: Reinstall Bot Code
run: |
source cf-scripts/tests_integration/clear_runner.sh
source cf-scripts/autotick-bot/install_bot_code.sh --no-clean-disk-space --no-pull-container

- name: "[Test] Make Graph (Node Attributes)"
run: |
cd cf-graph
conda-forge-tick --debug make-graph
env:
CF_TICK_FRAC_MAKE_GRAPH: 1.0

- name: "[Test] Deploy to GitHub"
run: |
cd cf-graph
conda-forge-tick --debug deploy-to-github

- name: Reinstall Bot Code
run: |
source cf-scripts/tests_integration/clear_runner.sh
source cf-scripts/autotick-bot/install_bot_code.sh --no-clean-disk-space --no-pull-container

- name: "[Test] update-upstream-versions"
run: |
cd cf-graph
conda-forge-tick --debug update-upstream-versions
env:
http_proxy: http://127.0.0.1:8080
https_proxy: http://127.0.0.1:8080
SSL_CERT_FILE: /etc/ssl/certs/ca-certificates.crt
REQUESTS_CA_BUNDLE: /etc/ssl/certs/ca-certificates.crt
CF_FEEDSTOCK_OPS_CONTAINER_PROXY_MODE: true
CF_FEEDSTOCK_OPS_PROXY_IN_CONTAINER: http://172.17.0.1:8080

- name: "[Test] Deploy to GitHub"
run: |
cd cf-graph
conda-forge-tick --debug deploy-to-github

- name: Reinstall Bot Code
run: |
source cf-scripts/tests_integration/clear_runner.sh
source cf-scripts/autotick-bot/install_bot_code.sh --no-clean-disk-space --no-pull-container

- name: "[Test] make-migrators (1/2)"
run: |
cd cf-graph
conda-forge-tick --debug make-migrators
env:
http_proxy: http://127.0.0.1:8080
https_proxy: http://127.0.0.1:8080
SSL_CERT_FILE: /etc/ssl/certs/ca-certificates.crt
REQUESTS_CA_BUNDLE: /etc/ssl/certs/ca-certificates.crt
CF_FEEDSTOCK_OPS_CONTAINER_PROXY_MODE: true
CF_FEEDSTOCK_OPS_PROXY_IN_CONTAINER: http://172.17.0.1:8080

- name: "[Test] Deploy to GitHub"
run: |
cd cf-graph
conda-forge-tick --debug deploy-to-github

- name: Reinstall Bot Code
run: |
source cf-scripts/tests_integration/clear_runner.sh
source cf-scripts/autotick-bot/install_bot_code.sh --no-clean-disk-space --no-pull-container

- name: "[Test] auto-tick (1/2)"
run: |
cd cf-graph
conda-forge-tick --debug auto-tick
env:
http_proxy: http://127.0.0.1:8080
https_proxy: http://127.0.0.1:8080
SSL_CERT_FILE: /etc/ssl/certs/ca-certificates.crt
REQUESTS_CA_BUNDLE: /etc/ssl/certs/ca-certificates.crt
CF_FEEDSTOCK_OPS_CONTAINER_PROXY_MODE: true
CF_FEEDSTOCK_OPS_PROXY_IN_CONTAINER: http://172.17.0.1:8080

- name: "[Test] Deploy to GitHub"
run: |
cd cf-graph
conda-forge-tick --debug deploy-to-github

- name: Reinstall Bot Code
run: |
source cf-scripts/tests_integration/clear_runner.sh
source cf-scripts/autotick-bot/install_bot_code.sh --no-clean-disk-space --no-pull-container

- name: "[Test] make-migrators (2/2)"
run: |
cd cf-graph
conda-forge-tick --debug make-migrators
env:
http_proxy: http://127.0.0.1:8080
https_proxy: http://127.0.0.1:8080
SSL_CERT_FILE: /etc/ssl/certs/ca-certificates.crt
REQUESTS_CA_BUNDLE: /etc/ssl/certs/ca-certificates.crt
CF_FEEDSTOCK_OPS_CONTAINER_PROXY_MODE: true
CF_FEEDSTOCK_OPS_PROXY_IN_CONTAINER: http://172.17.0.1:8080

- name: "[Test] Deploy to GitHub"
run: |
cd cf-graph
conda-forge-tick --debug deploy-to-github

- name: Reinstall Bot Code
run: |
source cf-scripts/tests_integration/clear_runner.sh
source cf-scripts/autotick-bot/install_bot_code.sh --no-clean-disk-space --no-pull-container

- name: "[Test] auto-tick (2/2)"
run: |
cd cf-graph
conda-forge-tick --debug auto-tick
env:
http_proxy: http://127.0.0.1:8080
https_proxy: http://127.0.0.1:8080
SSL_CERT_FILE: /etc/ssl/certs/ca-certificates.crt
REQUESTS_CA_BUNDLE: /etc/ssl/certs/ca-certificates.crt
CF_FEEDSTOCK_OPS_CONTAINER_PROXY_MODE: true
CF_FEEDSTOCK_OPS_PROXY_IN_CONTAINER: http://172.17.0.1:8080

- name: "[Test] Deploy to GitHub"
run: |
cd cf-graph
conda-forge-tick --debug deploy-to-github

- name: Validate Scenario
run: |
cd cf-scripts
python -m tests_integration.step_validate
env:
SCENARIO_ID: ${{ matrix.scenario_id }}
TEST_SETUP_TOKEN: ${{ secrets.GH_TOKEN_STAGING_BOT_USER }}

- name: Print Proxy Logs
if: always()
run: cat /tmp/mitmproxy.log
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ docs/_build/

node_attrs/*
graph.json
!tests_integration/resources/empty-graph/graph.json
pr_json/*
pr_status/*
status/*
Expand Down
9 changes: 9 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[submodule "tests_integration/definitions/conda-forge-pinning/resources/feedstock"]
path = tests_integration/definitions/conda-forge-pinning/resources/feedstock
url = https://github.com/conda-forge/conda-forge-pinning-feedstock.git
[submodule "tests_integration/definitions/pydantic/resources/feedstock"]
path = tests_integration/definitions/pydantic/resources/feedstock
url = https://github.com/conda-forge/pydantic-feedstock.git
[submodule "tests_integration/definitions/pydantic/resources/feedstock_v1"]
path = tests_integration/definitions/pydantic/resources/feedstock_v1
url = https://github.com/conda-forge/pydantic-feedstock.git
1 change: 1 addition & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ repos:
rev: typos-dict-v0.12.4
hooks:
- id: typos
exclude: ^tests_integration\/definitions\/.*\/resources\/

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.9.4
Expand Down
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ RUN conda activate base && \
pip install --no-deps --no-build-isolation -e . && \
cd - && \
conda deactivate && \
conda deactivate
conda deactivate && \
rm -rf $AUTOTICK_BOT_DIR/.git # was needed by setuptools-scm for package install
# but can delete now

# now make the conda user for running tasks and set the user
RUN useradd --shell /bin/bash -c "" -m conda
Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,8 @@ If your migrator needs special configuration, you should write a new factory fun
- `CF_FEEDSTOCK_OPS_CONTAINER_NAME`: the name of the container to use in the bot, otherwise defaults to `ghcr.io/regro/conda-forge-tick`
- `CF_FEEDSTOCK_OPS_CONTAINER_TAG`: set this to override the default container tag used in production runs, otherwise the value of `__version__` is used

Additional environment variables are described in [the settings module](conda_forge_tick/settings.py).

### Getting a Working Environment

The bot has an abstract set of requirements stored in the `environment.yml` file in this repo.
Expand Down Expand Up @@ -299,6 +301,10 @@ Currently, the following commands are supported and tested:

- `update-upstream-versions`

### Integration Tests

See [tests_integration/README.md](tests_integration/README.md).

### Structure of the Bot's Jobs

#### History
Expand Down
Loading