feat(pkg/plan): complete public plan library per RFD 0053#3
Draft
Copilot wants to merge 6 commits into
Draft
Conversation
Signed-off-by: Carlos Salas <carlos.salas@suse.com>
Agent-Logs-Url: https://github.com/salasberryfin/rancher/sessions/f5d5ff3b-9411-4f3a-88ea-fd23f5fd4029 Co-authored-by: salasberryfin <10220061+salasberryfin@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix go.mod version and split types.go into focused files
feat(pkg/plan): complete public plan library per RFD 0053
Apr 8, 2026
…her/rancher Agent-Logs-Url: https://github.com/salasberryfin/rancher/sessions/e280fa00-7e9f-43f7-bae0-ea92d1ac490a Co-authored-by: salasberryfin <10220061+salasberryfin@users.noreply.github.com>
Agent-Logs-Url: https://github.com/salasberryfin/rancher/sessions/930b3280-7af9-474f-b082-82fd285c766d Co-authored-by: salasberryfin <10220061+salasberryfin@users.noreply.github.com>
Agent-Logs-Url: https://github.com/salasberryfin/rancher/sessions/0b729836-e116-482f-bbd1-95fa37ff8c38 Co-authored-by: salasberryfin <10220061+salasberryfin@users.noreply.github.com>
cc056f8 to
7079fbb
Compare
1cf2c84 to
fc33163
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
pkg/plan/plan_test.gofor readabilityTestChecksum: determinism assertion comparedChecksum(input)against itself (always true); capture results in two variables insteadOriginal prompt
Context
PR #2 (
0264_public_plan_librarybranch) introduces a newpkg/planpackage insalasberryfin/rancheras a public plan library for the system-agent, as described in RFD 0053. The current PR only adds two files:pkg/plan/go.modandpkg/plan/types.go.Goal
Improve the existing
pkg/planpackage based on a review against RFD 0053 and the source of truth inrancher/system-agent. Do not make any changes to system-agent itself — that is handled in a follow-up.Required Changes
1. Fix
pkg/plan/go.modThe current
go.modspecifiesgo 1.25.0which does not exist. Fix it to use a valid Go version that matches therancher/rancherrepository (usego 1.23or whatever is used in the rootgo.modofrancher/rancher). Remove thetoolchaindirective if it references a non-existent version.2. File structure: split
types.gointo focused filesThe single
types.gois acceptable but splitting it into focused files improves navigability for external consumers. Suggested structure:pkg/plan/types.go— core plan types:Plan,File,CommonInstruction,OneTimeInstruction,PeriodicInstruction,PeriodicInstructionOutputpkg/plan/probe.go— probe types:Probe,HTTPGetAction,ProbeStatuspkg/plan/state.go— plan state type, constants, and Secret field name constantspkg/plan/plan.go— helper functions:Parse,ChecksumOnly do the split if it genuinely improves the package. If it adds complexity without benefit, keep everything in
types.goplus add the new files for state constants and helpers.3. Add
pkg/plan/state.goAdd a new file defining the plan lifecycle state type and all constants that external consumers need. These are currently missing from the library entirely:
4. Add
PeriodicInstructionOutputto the typesThis type is part of the public contract (consumers need it to decode
applied-periodic-output). It currently lives only inrancher/system-agent/pkg/applyinator. Add it topkg/plan/types.go(or a dedicated file):5. Add
pkg/plan/plan.gowithParseandChecksumhelpersThe RFD specifies the library should provide JSON parsing with validation and content hash computation. Add: