Skip to content

KT: changes needed for cve_remediation automation in github action#59

Merged
roxanan1996 merged 5 commits intomainlinefrom
{rnicolescu}_cve_remediation_automation
Mar 5, 2026
Merged

KT: changes needed for cve_remediation automation in github action#59
roxanan1996 merged 5 commits intomainlinefrom
{rnicolescu}_cve_remediation_automation

Conversation

@roxanan1996
Copy link
Contributor

@roxanan1996 roxanan1996 commented Mar 5, 2026

It started from needing a way to list the kernels we support.

kt list-kernels

but cbr7.9 and fipslegacy are not fully automated.
This is how I came up with an extra flag automated.

For cve remediation automation, the user will be ciq_kernel_automation.
And not the system one. To make it possible, user is now configurable. By default it will be taken from env var USER.

Last thing required to use kt in a github action was to make sure the files under ktlib/data are accessible when kt is installed as a package.

This has been consolidated into lts9.2.

Signed-off-by: Roxana Nicolescu <rnicolescu@ciq.com>
Useful for kernels that have kernelCI supported.
They are still "alive" but with limited support, that is why they are not
deleted from this list.

Signed-off-by: Roxana Nicolescu <rnicolescu@ciq.com>
It will show only the kernels that are automated in kernelCI.

Signed-off-by: Roxana Nicolescu <rnicolescu@ciq.com>
Copilot AI review requested due to automatic review settings March 5, 2026 15:18
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds support for filtering kernel listings to “automated” targets and ensures YAML data files are packaged so kt works reliably in GitHub Actions.

Changes:

  • Package kt/data/*.yaml into the wheel/sdist via setuptools configuration.
  • Introduce an automated attribute in kernel metadata and expose --automated/-a in kt list-kernels.
  • Replace direct $USER lookups with config.user in VM/cloud-init and workspace paths.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
pyproject.toml Includes YAML package data so runtime loading works in CI/GitHub Actions.
kt/ktlib/vm.py Uses configured user instead of $USER when generating cloud-init.
kt/ktlib/kernels.py Adds automated flag to kernel metadata model.
kt/ktlib/kernel_workspace.py Uses configured user instead of $USER during workspace setup.
kt/ktlib/config.py Adds user to config and adjusts path coercion logic accordingly.
kt/data/kernels.yaml Adds automated markers per kernel; removes an older fips entry.
kt/commands/list_kernels/impl.py Adds filtering and stable sorting by kernel name.
kt/commands/list_kernels/command.py Adds --automated/-a CLI option and updates epilog examples.
Comments suppressed due to low confidence (1)

kt/ktlib/config.py:1

  • Config.DEFAULT still uses os.environ["USER"], which will raise KeyError in environments where USER isn’t set (common in GitHub Actions), undermining the goal of making the tool CI-friendly. Use a safer default (e.g., os.environ.get("USER"), getpass.getuser(), or a documented fallback) and keep config.user as the single source of truth.
import json

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

By default it will be the env var $USER if no config is included.

Signed-off-by: Roxana Nicolescu <rnicolescu@ciq.com>
Signed-off-by: Roxana Nicolescu <rnicolescu@ciq.com>
@roxanan1996 roxanan1996 force-pushed the {rnicolescu}_cve_remediation_automation branch from 4bb9390 to 5a32116 Compare March 5, 2026 15:33
Copy link
Collaborator

@PlaidCat PlaidCat left a comment

Choose a reason for hiding this comment

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

:shipit:

Copy link
Collaborator

@bmastbergen bmastbergen left a comment

Choose a reason for hiding this comment

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

🥌

@roxanan1996 roxanan1996 merged commit 96d6e4c into mainline Mar 5, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants