Skip to content

Cobbler 4.0.0 compability#82

Draft
SchoolGuy wants to merge 23 commits into
mainfrom
feature/cobbler-4-0-0
Draft

Cobbler 4.0.0 compability#82
SchoolGuy wants to merge 23 commits into
mainfrom
feature/cobbler-4-0-0

Conversation

@SchoolGuy

Copy link
Copy Markdown
Member

Fixes #81

This PR adds compatibility with the upcoming 4.0.0 release.

@SchoolGuy SchoolGuy moved this to Pull Requests in Golang Client Jun 9, 2026
@SchoolGuy SchoolGuy added this to the v1.0.0 milestone Jun 9, 2026
@codacy-production

codacy-production Bot commented Jun 9, 2026

Copy link
Copy Markdown

Not up to standards ⛔

🔴 Issues 3 critical · 13 high · 34 medium · 2 minor

Alerts:
⚠ 52 issues (≤ 0 issues of at least minor severity)

Results:
52 new issues

Category Results
Security 2 minor
13 high
3 critical
34 medium

View in Codacy

🟢 Metrics 222 complexity · 22 duplication

Metric Results
Complexity 222
Duplication 22

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@SchoolGuy SchoolGuy force-pushed the feature/cobbler-4-0-0 branch from a16c40a to b18d188 Compare June 16, 2026 13:53
@SchoolGuy SchoolGuy force-pushed the feature/cobbler-4-0-0 branch 2 times, most recently from 22b1612 to e6f2c3d Compare June 23, 2026 15:09
Adds the new NetworkInterface item type that the Cobbler 4.0.0 backend exposes
as a peer of System/Distro/Profile rather than as a Dict embedded in System.

- network_interface.go: NetworkInterface struct with nested IPv4Option,
  IPv6Option, DNSInterfaceOption value objects; full CRUD wrappers
  (Get, GetHandle, GetSince, Find, FindNames, Create, Update, Save, Copy,
  Delete, DeleteRecursive, Rename, ListNames). new_network_interface
  uniquely requires a system_uid parameter; the wrapper plumbs it through.

- system.go: drop the obsolete client-level interface mutation helpers
  (ModifyInterface, DeleteNetworkInterface, RenameNetworkInterface) and
  their System-method wrappers (CreateInterface, ModifyNetworkInterface,
  DeleteInterface, RenameInterface, makeInterfaceOptionsMap). The 4.0.0
  backend no longer routes interface writes through modify_system pseudo-
  attributes. The Interface struct, Interfaces type, NewInterface and the
  read-only System.GetInterfaces / GetInterface remain for now; the full
  swap to map[string]*NetworkInterface lives in a follow-up commit per
  Task 6 of the implementation plan.

- cobblerclient.go: drop the updateInterfaces branch in updateCobblerFields
  (Interfaces is now noupdate on System).

- cmd/main.go: update the runnable example to use the new top-level
  CreateNetworkInterface / DeleteNetworkInterface API.

- Tests: delete TestCreateInterface, TestModifyInterface, TestDeleteInterface,
  TestRenameInterface and their fixtures.

- go.mod: drop github.com/fatih/structs (only used by deleted code).
@SchoolGuy SchoolGuy force-pushed the feature/cobbler-4-0-0 branch 2 times, most recently from 88a4b45 to ecfd5d9 Compare June 30, 2026 11:12
SchoolGuy and others added 14 commits June 30, 2026 15:17
Adds the new Template item type that Cobbler 4.0.0 exposes for autoinstall
template management (Jinja2, Cheetah, etc.). The legacy file-based wrapper
(read_/write_/remove_autoinstall_template and get_autoinstall_templates)
is gone from the 4.0.0 backend, so the matching Go wrappers and fixtures
are removed.

- template_types.go: TemplateSchema enum (file/importlib/environment),
  URIOption struct (schema + path).
- template.go: Template struct, NewTemplate, convertRawTemplate, full CRUD
  wrappers, GetTemplateHandle, GetTemplatesSince, FindTemplate,
  FindTemplateNames, ListTemplateNames plus the content-management
  helpers GetTemplateContent / TemplatesRefreshContent /
  BackgroundTemplatesRefreshContent.
- Removed: template_file.go, template_file_test.go, the corresponding
  fixtures, the GetAutoinstallTemplates wrapper, and the cmd/main.go
  example block (replaced with the new CreateTemplate flow).

The TemplateFiles dict field on items (a separate per-item construct for
in-image file rendering) is unrelated and stays unchanged.
Cobbler 4.0.0 always supports the `resolved` boolean on the get_<item>
XML-RPC methods (the parameter was added in 3.3.3 and the v1.x client
targets 4.0.0+). Inline the post-3.3.3 wire shape in getConcreteItem and
update the get_<item> request fixtures to carry the extra param. Remove
the now-pointless CachedVersion presets from item tests.

The CachedVersion field on Client and the setCachedVersion helper stay
in place for ExtendedVersion consumers and any future version-gated work.
Python's save_item(what, object_id, with_triggers, with_sync, editmode, token)
takes 6 positional args. The Go client was passing only (what, objectId, token,
editmode) — missing with_triggers/with_sync, and swapping token and editmode.

Update SaveItem, SaveDistro, SaveProfile, SaveSystem, SaveRepo, SaveImage,
SaveMenu, SaveNetworkInterface, SaveTemplate to the correct 4-param Go signature
(objectId, withTriggers, withSync, editmode) with token appended internally via
c.Token. Fix CreateDistro/UpdateDistro which bypassed SaveDistro entirely and
called save_distro with only 2 args. Update all internal Create*/Update* callers.
Update corresponding test call sites and fixture XML files.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Python's generate_autoinstall(obj_identifier, obj_type, obj_field,
autoinstaller_file, autoinstaller_subfile) takes 5 positional args.
The Go client was passing only (profile, system) — mapping them to
obj_identifier and obj_type while ignoring obj_field and the two
optional file overrides.

Update GenerateAutoinstall to accept all 5 parameters. Update the
test call site and request fixture to match the new signature.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
BackgroundSignatureReload wraps
background_signature_reload to reload OS detection signatures from disk.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@SchoolGuy SchoolGuy force-pushed the feature/cobbler-4-0-0 branch from ecfd5d9 to ffd9506 Compare June 30, 2026 14:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Pull Requests

Development

Successfully merging this pull request may close these issues.

Cobbler 4.0.0 compability

1 participant