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
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "hatchling.build"

[project]
name = "gds-idea-app-kit"
version = "0.2.3"
version = "0.2.4"
description = "CLI tool for scaffolding and maintaining GDS IDEA web apps on AWS"
readme = "README.md"
requires-python = ">=3.11"
Expand Down
6 changes: 6 additions & 0 deletions src/gds_idea_app_kit/init.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,12 @@ def run_init(framework: str, app_name: str, python_version: str) -> None:
project_dir / ".github" / "workflows" / "ci_cd_cdk_app.yml",
)

# -- Copy CI (PR) workflow --
_copy_template(
templates / "common" / "ci_pr_cdk_app.yml",
project_dir / ".github" / "workflows" / "ci_pr_cdk_app.yml",
)

# -- Copy .devcontainer/ files --
_copy_template(
templates / "common" / "devcontainer.json",
Expand Down
1 change: 1 addition & 0 deletions src/gds_idea_app_kit/manifest.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
# The dict maps template source path -> destination path in the project.
TOOL_OWNED_FILES = {
"common/ci_cd_cdk_app.yml": ".github/workflows/ci_cd_cdk_app.yml",
"common/ci_pr_cdk_app.yml": ".github/workflows/ci_pr_cdk_app.yml",
"common/devcontainer.json": ".devcontainer/devcontainer.json",
"common/docker-compose.yml": ".devcontainer/docker-compose.yml",
"dev_mocks/dev_mock_authoriser.json": "dev_mocks/dev_mock_authoriser.json",
Expand Down
6 changes: 1 addition & 5 deletions src/gds_idea_app_kit/templates/common/ci_cd_cdk_app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@ permissions:
pull-requests: write

jobs:
ci_pr_dev:
uses: co-cddo/gds-idea-workflows-catalogue/.github/workflows/ci_pr_dev.yml@main
with:
run-version-check: false

ci_build:
uses: co-cddo/gds-idea-workflows-catalogue/.github/workflows/ci_build.yml@main
Expand Down Expand Up @@ -43,5 +39,5 @@ jobs:
run-version-check: false

cd:
needs: [ci_pr_dev, ci_build, ci_pyproject_version, ci_lint, ci_tests, ci_cdk_diff]
needs: [ci_build, ci_pyproject_version, ci_lint, ci_tests, ci_cdk_diff]
uses: co-cddo/gds-idea-workflows-catalogue/.github/workflows/cd_workflow_cdk.yml@main
44 changes: 44 additions & 0 deletions src/gds_idea_app_kit/templates/common/ci_pr_cdk_app.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: CI (PR) Orchestrator for CDK Apps

on:
pull_request:
branches:
- prod
- dev

permissions:
contents: read
id-token: write
pull-requests: write

jobs:
ci_pr_dev:
uses: co-cddo/gds-idea-workflows-catalogue/.github/workflows/ci_pr_dev.yml@main
with:
run-version-check: false

ci_build:
uses: co-cddo/gds-idea-workflows-catalogue/.github/workflows/ci_build.yml@main
with:
run-version-check: false

ci_pyproject_version:
uses: co-cddo/gds-idea-workflows-catalogue/.github/workflows/ci_pyproject_version.yml@main
with:
run-version-check: false

ci_lint:
uses: co-cddo/gds-idea-workflows-catalogue/.github/workflows/ci_lint.yml@main
with:
run-version-check: false

ci_tests:
uses: co-cddo/gds-idea-workflows-catalogue/.github/workflows/ci_tests.yml@main
with:
run-version-check: false

ci_cdk_diff:
uses: co-cddo/gds-idea-workflows-catalogue/.github/workflows/ci_cdk_diff.yml@main
with:
run-version-check: false
secrets: inherit
3 changes: 3 additions & 0 deletions src/gds_idea_app_kit/templates/common/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ services:
# Mount app source for live editing and auto-reload
- ../app_src:/app

# Preserve container's .venv (prevents host .venv overwriting it)
- /app/.venv

# Mount dev mock files directory (can be empty)
- ../dev_mocks:/app/dev_mocks

Expand Down
2 changes: 0 additions & 2 deletions src/gds_idea_app_kit/templates/dash/dash_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@
# Your app logger
logger = logging.getLogger(__name__)

REDIRECT_URL = "https://gds-idea.click/401.html"

app = Dash(__name__)


Expand Down
4 changes: 2 additions & 2 deletions src/gds_idea_app_kit/templates/dash/pyproject.toml.template
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
[project]
name = "{{app_name}}"
version = "0.1.0"
version = "0.0.0" # Version managed in root pyproject.toml
description = "Dash app with Cognito authentication"
requires-python = ">={{python_version}}"
dependencies = [
"cognito-auth[dash] @ git+https://github.com/co-cddo/gds-idea-app-auth.git",
"gunicorn>=21.0.0",
"gunicorn>=25.1.0",
]

[tool.ruff]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "{{app_name}}"
version = "0.1.0"
version = "0.0.0" # Version managed in root pyproject.toml
description = "FastAPI app with Cognito authentication"
requires-python = ">={{python_version}}"
dependencies = [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "{{app_name}}"
version = "0.1.0"
version = "0.0.0" # Version managed in root pyproject.toml
description = "Streamlit app with Cognito authentication"
requires-python = ">={{python_version}}"
dependencies = [
Expand Down
2 changes: 0 additions & 2 deletions src/gds_idea_app_kit/templates/streamlit/streamlit_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@
# Your app logger
logger = logging.getLogger(__name__)

REDIRECT_URL = "https://gds-idea.click/401.html"

auth = StreamlitAuth()

user = auth.get_auth_user()
Expand Down
4 changes: 3 additions & 1 deletion tests/test_manifest.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ def tracked_project(project_dir):
(project_dir / ".devcontainer" / "docker-compose.yml").write_text("services:")
(project_dir / ".github" / "workflows").mkdir(parents=True)
(project_dir / ".github" / "workflows" / "ci_cd_cdk_app.yml").write_text("name: CI/CD")
(project_dir / ".github" / "workflows" / "ci_pr_cdk_app.yml").write_text("name: CI PR")
(project_dir / "dev_mocks").mkdir()
(project_dir / "dev_mocks" / "dev_mock_authoriser.json").write_text("{}")
(project_dir / "dev_mocks" / "dev_mock_user.json").write_text("{}")
Expand Down Expand Up @@ -87,6 +88,7 @@ def test_tracked_files_include_common_destinations(framework):
tracked = get_tracked_files(framework)
destinations = set(tracked.values())
assert ".github/workflows/ci_cd_cdk_app.yml" in destinations
assert ".github/workflows/ci_pr_cdk_app.yml" in destinations
assert ".devcontainer/devcontainer.json" in destinations
assert ".devcontainer/docker-compose.yml" in destinations
assert "dev_mocks/dev_mock_authoriser.json" in destinations
Expand Down Expand Up @@ -177,7 +179,7 @@ def test_build_manifest_hashes_all_tracked_files(tracked_project):
assert result["framework"] == "streamlit"
assert result["app_name"] == "test-app"
assert result["tool_version"] == "0.1.0"
assert len(result["files"]) == 6
assert len(result["files"]) == 7
for file_hash in result["files"].values():
assert file_hash.startswith("sha256:")

Expand Down
2 changes: 1 addition & 1 deletion uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading