Skip to content

Fix unrecognised tags causing ValueError on container/user load#14

Merged
skokec merged 4 commits into
masterfrom
copilot/fix-enable-fuse-tag-issues
Jun 16, 2026
Merged

Fix unrecognised tags causing ValueError on container/user load#14
skokec merged 4 commits into
masterfrom
copilot/fix-enable-fuse-tag-issues

Conversation

Copilot AI commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Any YAML entry containing a tag not registered in the column ordering list (e.g. ENABLE_FUSE: True) crashed on startup with ValueError: <tag> present in DataFrame but not in reordering. The root cause was that both the ordering guard and the UI hardcoded a fixed set of known tags, requiring a code change for every new tag added.

Changes

  • yamlhandler.py (load_users and load_containers): Replaced the strict ValueError guard with a dynamic effective_order that appends any unknown columns to the end of the known ordering. No code changes are needed when new tags are introduced in the YAML.

  • container.py: Rewrote the tags multiselect to discover boolean tag columns dynamically from the DataFrame. Well-known tags retain short aliases (DOCKERENABLE_DOCKER_ACCESS, PRIVILEGEDRUN_PRIVILEGED); any additional column not handled by a dedicated UI widget (e.g. ENABLE_FUSE, or any future tag) appears automatically using its column name — without requiring any code changes.

# yamlhandler.py — before (crashes on unknown tag)
for k in df.columns:
    if k not in order:
        raise ValueError(f'{k} present in DataFrame but not in reordering')
df = df[order]

# after (unknown columns appended automatically)
effective_order = order + [k for k in df.columns if k not in order]
df = df[effective_order]

Copilot AI changed the title [WIP] Fix ENABLE_FUSE tag issues causing ValueError Fix ENABLE_FUSE tag causing ValueError on container load Jun 16, 2026
Copilot AI requested a review from skokec June 16, 2026 09:20
@skokec

skokec commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

@copilot you need to make this work for any new tag, do not just hardcode existing ones

Copilot AI commented Jun 16, 2026

Copy link
Copy Markdown
Contributor Author

@copilot you need to make this work for any new tag, do not just hardcode existing ones

Done. The fix is now fully generic:

  • yamlhandler.py (load_users and load_containers): Replaced the ValueError guard with effective_order = order + [k for k in df.columns if k not in order] — any unknown column is appended automatically instead of crashing.
  • container.py: The tags multiselect now discovers all boolean-style columns dynamically. Well-known tags keep short aliases (DOCKER, PRIVILEGED); any new column not in the explicitly non-tag set (e.g. ENABLE_FUSE, or any future tag) appears automatically using its column name.

No hardcoded additions needed for future tags.

Copilot AI changed the title Fix ENABLE_FUSE tag causing ValueError on container load Fix unrecognised tags causing ValueError on container/user load Jun 16, 2026
@skokec skokec marked this pull request as ready for review June 16, 2026 09:31
Copilot AI review requested due to automatic review settings June 16, 2026 09:31
@skokec skokec merged commit caaf1fd into master Jun 16, 2026
1 check passed

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR prevents startup crashes when user/container YAML entries include previously-unregistered columns (“tags”) by making column handling and tag UI generation more dynamic, so new tags don’t require code updates to load safely.

Changes:

  • yamlhandler.py: Replaces the strict “unknown column” ValueError guard with a dynamic effective_order that appends unknown columns to the end before reordering.
  • container.py: Updates the “Tags” multiselect to build its options from the DataFrame columns, preserving short aliases for well-known tags.

Reviewed changes

Copilot reviewed 2 out of 16 changed files in this pull request and generated 1 comment.

File Description
yamlhandler.py Appends unknown YAML/DataFrame columns to the ordering to avoid crashes while preserving a stable column layout.
container.py Dynamically derives tag options from container DataFrame columns and maps well-known tags to short display aliases.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread container.py
Comment on lines +69 to +71
for col in container_df.columns:
if col not in _non_tag_cols and col not in _known_tag_cols:
_tag_map[col] = col
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants