Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
9 changes: 9 additions & 0 deletions .openapi-generator-ignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,12 @@ scripts/**
# Protect custom tests and examples
tests/**
examples/**

# Protect our own CI workflows + CODEOWNERS. The Python openapi-generator
# template writes a default .github/workflows/python.yml on every regen,
# and post_generate.py used to `shutil.rmtree('.github')` to clean it up —
# which collateral-deleted our entire .github/ tree (generate.yml,
# publish-pypi.yml, publish-testpypi.yml, sdk-update.yml, CODEOWNERS).
# Adding the directory here means the generator never writes there in the
# first place, so there's nothing for the cleanup step to nuke.
.github/**
9 changes: 8 additions & 1 deletion scripts/post_generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,16 @@ def cleanup_generator_artifacts() -> None:
"""Remove unwanted files the generator may leave at the project root."""
print("Cleaning up generator artifacts...")

# NOTE: do NOT add ".github" to this list. The Python openapi-generator
# template used to write a default .github/workflows/python.yml, and an
# earlier version of this script `shutil.rmtree`'d the whole .github/
# dir to clean that up — which collateral-deleted our own workflows
# (generate.yml, publish-pypi.yml, publish-testpypi.yml, sdk-update.yml)
# and CODEOWNERS on every regen. We now block the generator from writing
# to .github/ via .openapi-generator-ignore instead, so there's nothing
# to clean up here.
for unwanted in [
".gitlab-ci.yml",
".github",
"test-requirements.txt",
]:
path = PROJECT_ROOT / unwanted
Expand Down