Let plugins declare the header artifact indicator per variant kind
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 35/100
Research direction
Start with the plugin registry in server/orcaster_server/plugins.py and the artifact indicator logic in server/orcaster_server/api/admin_ui.py; read the existing hook validation and tests. Trace how registry declarations reach the header and how workspace tasks are queried. Done means the acceptance criteria pass, README.md and server/.env.example document the behavior, and the CHANGELOG records the compatibility note.
Written by the indexing model from the issue text.
Description
Problem
The dashboard header artifact indicator (produced and uploaded) is configured by two global settings: ARTIFACT_INDICATOR_SUFFIX and ARTIFACT_INDICATOR_SYNC_STATUS_PATH (server/orcaster_server/config.py:257-263). When the suffix is set, the indicator is shown in every workspace (server/orcaster_server/api/admin_ui.py:308-314, server/orcaster_server/templates/base.html:70).
producedcounts artifacts whose path ends in the suffix, in the active workspace (server/orcaster_server/api/admin_ui.py:1057-1066). The query does not filter by tool, so it counts any task of any kind that writes a file with that suffix.uploadedcomes from one global status file (server/orcaster_server/api/admin_ui.py:2771).
The indicator belongs to one tool, but the core cannot say which. A workspace that only runs other tools still shows the indicator, with numbers that are not about its work.
The core already knows the tool of each task: tasks.variant_kind is set by a plugin extractor and indexed with tasks_variant_idx (server/orcaster_server/models.py:398-409). The plugin registry has add_variant_extractor, add_outcome_defaults and add_legacy_status_alias (server/orcaster_server/plugins.py:103, :119, :135), but no hook for the indicator.
Proposed change
- Add a registry hook, for example
registry.add_artifact_indicator(kind, suffix, sync_status_path=None). The plugin declares the kind and the suffix.sync_status_pathis only a default: the status file is written by an external sync job, so its path stays an operator setting. Validate it like the other hooks and raisePluginErrorwhen:kindhas no registered extractor (checked invalidate());- the kind already has an indicator;
suffixis empty or not a string, orsync_status_pathis not a string orNone.
- Expose the declared indicators on the frozen
Registry. - Add
t.variant_kind = :kindto theproducedquery when the indicator comes from a plugin. - Read
uploadedfromARTIFACT_INDICATOR_SYNC_STATUS_PATHwhen it is set, otherwise from thesync_status_pathof the declaration. - Show the indicator only in a workspace that has tasks of the declared kind (see Open questions). Other workspaces show the rest of the header unchanged, including the storage indicator.
- Document the hook in the plugin section of
README.md(next toREADME.md:420), and the fallback inserver/.env.example.
Compatibility
Existing deployments configure the indicator with the two env vars, and their plugins do not call the new hook yet.
Guard:
- The hook is additive. Plugins that do not call it keep loading.
- If no plugin declares an indicator and the env vars are set, the server keeps today's behavior: global suffix, global status file, indicator in every workspace. It logs one startup WARNING that names the new hook.
- If a plugin declares an indicator, the declared kind and suffix win over
ARTIFACT_INDICATOR_SUFFIX, with a startup WARNING that says so.ARTIFACT_INDICATOR_SYNC_STATUS_PATH, when set, still overrides the declared path, souploadedkeeps reading the file that the existing sync job writes. - When a plugin declares an indicator,
producedno longer counts artifacts of tasks whosevariant_kindis NULL. Existing rows keep the value they got at creation and are not backfilled (server/orcaster_server/models.py:397-409), so tasks created before the plugin had an extractor, or that no extractor recognized, drop out of the count. In existing workspacesproducedcan go down once the plugin declares. The release note says so. - A workspace allow-list setting for the sync status (for example
ARTIFACT_INDICATOR_SYNC_WORKSPACES, proposed separately) still applies when a plugin declares:uploadedis shown only in a workspace that is on the list and has tasks of the declared kind. The declaration does not override the list. - No database migration:
variant_kindalready exists and is indexed. - The
ARTIFACT_INDICATOR_SUFFIXfallback is removed only in a later release, announced in the CHANGELOG.ARTIFACT_INDICATOR_SYNC_STATUS_PATHstays as an operator override.
Acceptance criteria
- The registry exposes the hook. Tests cover an unknown kind, a duplicate declaration and invalid values, each raising
PluginError. - Test: with a declared indicator,
produceddoes not count artifacts with the suffix from tasks of another kind. - Test: a workspace with tasks of the declared kind shows the indicator, and a workspace without them does not.
- Test: with the env vars set and no declaration, the indicator output is identical to today and a startup WARNING names the hook.
- Test: with both a declaration and the env vars, the declared kind and suffix win and a WARNING is logged.
- Test: with a declaration and
ARTIFACT_INDICATOR_SYNC_STATUS_PATHset,uploadedreads the env path, not the declared one. - Test: with a declared indicator, an artifact with the suffix from a task whose
variant_kindis NULL is not counted inproduced. The release note states thatproducedcan go down in existing workspaces. - Test: with a declared indicator and a workspace allow-list setting,
uploadedis shown only in a listed workspace that has tasks of the declared kind. - Existing deployments keep working without config changes.
-
README.mddocuments the hook andserver/.env.examplemarksARTIFACT_INDICATOR_SUFFIXas a fallback andARTIFACT_INDICATOR_SYNC_STATUS_PATHas an override. - CHANGELOG entry under Unreleased.
Open questions
- Visibility rule: show the indicator when the workspace has any task of the declared kind, or only when
produced > 0? - In which release is the
ARTIFACT_INDICATOR_SUFFIXfallback removed? Keeping it for at least one release lets existing deployments upgrade the server before their plugin registers the hook. - Should one kind be able to declare more than one indicator?
- Dominant language
- Python
- Stars
- 0
- Forks
- 0
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 10
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from AInvirion/orcaster
-
enhancement P3 server
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
Maintainers usually reply within 1 day
-
enhancement good first issue P3 server
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
bug P2 server
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
Maintainers usually reply within 1 day
-
bug P3 server
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
enhancement P3 server
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Maintainers usually reply within 1 day
All issues in AInvirion/orcaster
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 69/100
daniel-ospina/tortoise#15308 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
Maintainers usually reply within 1 day
-
difficulty:easy prio:low type:bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
NatronGitHub/Natron#2405 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Jstar269/nakagawa-recomp#3746 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day