Skip to content

Commit 818562a

Browse files
authored
Merge pull request #21 from TaskarCenterAtUW/develop
Tasking Manager MVP
2 parents 9bb02ee + 0d15a4e commit 818562a

44 files changed

Lines changed: 14250 additions & 6 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ name: CI
22

33
on:
44
push:
5-
branches: [ main ]
5+
branches: [ main, develop ]
66
pull_request:
7-
branches: [ main ]
7+
branches: [ main, develop ]
88

99
jobs:
1010
lint:

.github/workflows/tag.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Whenever there is a pull request merged into the branches, create tag
2+
name: Update Environment Tag
3+
on:
4+
pull_request:
5+
types: [closed]
6+
branches:
7+
- develop
8+
- staging
9+
- production
10+
jobs:
11+
update-tag:
12+
if: github.event.pull_request.merged == true
13+
runs-on: ubuntu-latest
14+
permissions:
15+
contents: write
16+
steps:
17+
- name: Checkout code
18+
uses: actions/checkout@v4
19+
with:
20+
fetch-depth: 1
21+
- name: Get the current branch name
22+
id: get_branch
23+
run: |
24+
TARGET_BRANCH="${{ github.event.pull_request.base.ref }}"
25+
26+
if [ "$TARGET_BRANCH" = "develop" ]; then
27+
echo "ENV_TAG=dev" >> $GITHUB_ENV
28+
elif [ "$TARGET_BRANCH" = "staging" ]; then
29+
echo "ENV_TAG=stage" >> $GITHUB_ENV
30+
elif [ "$TARGET_BRANCH" = "production" ]; then
31+
echo "ENV_TAG=prod" >> $GITHUB_ENV
32+
else
33+
echo "ENV_TAG=" >> $GITHUB_ENV
34+
fi
35+
- name: Force update tag
36+
if: ${{ env.ENV_TAG != '' }}
37+
run: |
38+
git config user.name "github-actions[bot]"
39+
git config user.email "github-actions[bot]@users.noreply.github.com"
40+
echo "Targeting tag: ${{ env.ENV_TAG }}"
41+
git tag -f $ENV_TAG
42+
git push origin $ENV_TAG --force

.gitignore

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,4 +163,10 @@ alembic/versions/.DS_Store
163163
/workspaces-openstreetmap-website
164164
pg_user_cache.sqlite
165165

166-
.env**
166+
.env**
167+
integration-report.html
168+
docs/tasking-mvp/tasking-mvp.postman_collection.json
169+
docs/tasking-mvp/tasking-mvp.postman_environment.json
170+
docs/tasking-mvp/_enrich_postman.py
171+
docs/tasking-mvp/feature-coverage.md
172+
.idea/

.vscode/extensions.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"recommendations": [
3+
"ms-python.python",
4+
"ms-python.vscode-pylance"
5+
]
6+
}

alembic_osm/versions/9221408912dd_add_user_role_table.py

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import sqlalchemy as sa
1212
from alembic import op
1313
from sqlalchemy import inspect, text
14+
from sqlalchemy.dialects import postgresql
1415

1516
# revision identifiers, used by Alembic.
1617
revision: str = "9221408912dd"
@@ -24,6 +25,25 @@ def upgrade() -> None:
2425
assert bind is not None
2526
insp = inspect(bind)
2627

28+
# `users` is normally owned and migrated by the OSM Rails app. When
29+
# running against a fresh database without Rails (CI/testcontainers,
30+
# or a dev box without the osm-rails service), create a minimal stub
31+
# so the FK from `tasking_project_roles`/`user_workspace_roles` can
32+
# be added below. Guarded by has_table so the production-owned
33+
# schema wins when it is already present.
34+
if not insp.has_table("users"):
35+
op.create_table(
36+
"users",
37+
# `id` matches the Rails `users.id` numeric PK so the FK
38+
# from `team_user.user_id` in the next migration can attach.
39+
sa.Column("id", sa.BigInteger(), autoincrement=True, nullable=False),
40+
sa.Column("auth_uid", sa.String(), nullable=False),
41+
sa.Column("email", sa.String(), nullable=True),
42+
sa.Column("display_name", sa.String(), nullable=True),
43+
sa.PrimaryKeyConstraint("id"),
44+
sa.UniqueConstraint("auth_uid", name="auth_uid_unique"),
45+
)
46+
2747
# Add unique constraint on users.auth_uid (if not already present)
2848
constraint_exists = bind.execute(
2949
text("SELECT 1 FROM pg_constraint WHERE conname = 'auth_uid_unique'")
@@ -49,7 +69,7 @@ def upgrade() -> None:
4969
sa.Column("workspace_id", sa.BigInteger(), nullable=False),
5070
sa.Column(
5171
"role",
52-
sa.Enum(
72+
postgresql.ENUM(
5373
"lead",
5474
"validator",
5575
"contributor",

0 commit comments

Comments
 (0)