Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
754d5ea
feat(framework): Add primary task id to run
danielnugraha Apr 27, 2026
f151d3f
Update schema
danielnugraha Apr 27, 2026
ab6134a
Merge branch 'main' into add-primary-task-id
danieljanes Apr 27, 2026
b931634
format and rename rev
jafermarq Apr 28, 2026
7b387d8
make `substatus` and `details` collumns in `Run` table not nullable
jafermarq Apr 28, 2026
0b417c4
fix migration
jafermarq Apr 28, 2026
9bfa347
rm `env.py` changes -- moved to PR#7057
jafermarq Apr 28, 2026
5baaa13
rev modifying `details` and `sub_status` columns in `Run` table
jafermarq Apr 28, 2026
435c1e3
Merge branch 'main' into add-primary-task-id
jafermarq Apr 28, 2026
0b74a40
wip
jafermarq Apr 28, 2026
57eba5d
Merge branch 'add-primary-task-id' into extend-corestate-methods
jafermarq Apr 28, 2026
3e26e47
post merge tweaks
jafermarq Apr 28, 2026
7593997
Merge branch 'add-primary-task-id' into extend-corestate-methods
jafermarq Apr 28, 2026
7b7e242
(WIP) tokens store for sql
jafermarq Apr 28, 2026
7faa407
add `active_until` to `task` table
jafermarq Apr 28, 2026
3ed585a
clearer tests
jafermarq Apr 28, 2026
00044c8
tweaks
jafermarq Apr 29, 2026
c0a94f6
parameterize test
jafermarq Apr 29, 2026
4187395
Apply suggestions from code review
jafermarq Apr 29, 2026
8c694d8
if a token expires and task is not finished, finish it with substatus…
jafermarq Apr 29, 2026
07907aa
rm `determine_task_status` helper function
jafermarq Apr 29, 2026
88a1ed4
finish a run with substatus `COMPLETED` requires it to be `RUNNING` f…
jafermarq Apr 29, 2026
bf45bb4
Apply suggestion from @panh99
panh99 Apr 29, 2026
435e752
merge w/ `main`
jafermarq Apr 29, 2026
614aae6
cleaup token before finish in SQL
jafermarq Apr 30, 2026
7dbf8cd
`sub_status`; `pylint`
jafermarq Apr 30, 2026
01715e4
update `activate_task`; rm session in expire_tokens helper
jafermarq Apr 30, 2026
8d3eee7
init
jafermarq Apr 30, 2026
1cb7efb
merge w/ `main`
jafermarq Apr 30, 2026
8023690
Potential fix for pull request finding
jafermarq Apr 30, 2026
aa999b6
Merge branch 'main' into update-run-table
jafermarq May 1, 2026
fd9c03e
Merge branch 'main' into update-run-table
jafermarq May 5, 2026
5cdc1e6
Potential fix for pull request finding
jafermarq May 6, 2026
db0589d
Merge branch 'main' into update-run-table
jafermarq May 6, 2026
ca2d75c
Merge branch 'main' into update-run-table
chongshenng May 6, 2026
eaf4dbb
Merge branch 'main' into update-run-table
danieljanes May 6, 2026
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# Copyright 2026 Flower Labs GmbH. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
"""Make run sub_status and details not nullable.

Revision ID: e566a1e755c5
Revises: c7eb009ce75c
Create Date: 2026-04-30 09:43:42.202183
"""
from collections.abc import Sequence

import sqlalchemy as sa
from alembic import op

# pylint: disable=no-member

# revision identifiers, used by Alembic.
revision: str = "e566a1e755c5"
down_revision: str | Sequence[str] | None = "c7eb009ce75c"
branch_labels: str | Sequence[str] | None = None
depends_on: str | Sequence[str] | None = None


def upgrade() -> None:
"""Upgrade schema."""
# Backfill existing NULLs before enforcing NOT NULL.
op.execute("UPDATE run SET sub_status = '' WHERE sub_status IS NULL")
op.execute("UPDATE run SET details = '' WHERE details IS NULL")
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table("run", schema=None) as batch_op:
batch_op.alter_column(
"sub_status",
existing_type=sa.VARCHAR(),
server_default=sa.text("''"),
nullable=False,
)
batch_op.alter_column(
"details",
existing_type=sa.VARCHAR(),
server_default=sa.text("''"),
nullable=False,
)

# ### end Alembic commands ###


def downgrade() -> None:
"""Downgrade schema."""
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table("run", schema=None) as batch_op:
batch_op.alter_column(
"details", existing_type=sa.VARCHAR(), server_default=None, nullable=True
)
batch_op.alter_column(
"sub_status", existing_type=sa.VARCHAR(), server_default=None, nullable=True
)

# ### end Alembic commands ###
4 changes: 2 additions & 2 deletions framework/py/flwr/supercore/state/schema/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ erDiagram
BIGINT bytes_recv "nullable"
BIGINT bytes_sent "nullable"
FLOAT clientapp_runtime "nullable"
VARCHAR details "nullable"
VARCHAR details
VARCHAR fab_hash "nullable"
VARCHAR fab_id "nullable"
VARCHAR fab_version "nullable"
Expand All @@ -109,7 +109,7 @@ erDiagram
VARCHAR run_type
VARCHAR running_at "nullable"
VARCHAR starting_at "nullable"
VARCHAR sub_status "nullable"
VARCHAR sub_status
VARCHAR usage_reported_at
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ def create_linkstate_metadata() -> MetaData:
Column("running_at", String),
Column("finished_at", String),
Column("usage_reported_at", String, nullable=False, server_default=text("''")),
Column("sub_status", String),
Column("details", String),
Column("sub_status", String, nullable=False, server_default=text("''")),
Column("details", String, nullable=False, server_default=text("''")),
Column("federation", String),
Column("primary_task_id", BigInteger, nullable=True),
Column("federation_config", String),
Expand Down
Loading