Skip to content

feat(mac-crafter): Build with craftmaster config - #11435

Open
claucambra wants to merge 12 commits into
masterfrom
work/mac-crafter-craftmaster-defaults
Open

claucambra wants to merge 12 commits into
masterfrom
work/mac-crafter-craftmaster-defaults

Conversation

@claucambra

@claucambra claucambra commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Summary

mac-crafter now reads blueprint revisions, build type, and test settings from craftmaster.ini, so its defaults stay in sync with the repository. The current config selects the stable-35.0 blueprints during Craft setup and enables test builds.

Checklist

AI (if applicable)

@claucambra claucambra added this to the 35.1.0 milestone Nov 26, 2026
@claucambra claucambra self-assigned this Nov 26, 2026
@claucambra claucambra added the os: 🍎 macOS Apple macOS, formerly also known as OS X label Nov 26, 2026
@claucambra
claucambra requested a review from i2h3 as a code owner November 26, 2026 14:00
@claucambra
claucambra force-pushed the work/mac-crafter-craftmaster-defaults branch 2 times, most recently from 459371a to 260220f Compare November 26, 2026 15:02
Bundle a standalone adapter for CraftMaster’s Config.py so settings are read with the same INI syntax and target precedence as CraftMaster.

Assisted-by: Codex:gpt-6
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
Clone CraftMaster before reading repository defaults. Apply those defaults during setup and builds while honoring command-line overrides.

Assisted-by: Codex:gpt-6
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
Distinguish Git branches from pinned tags and commits before forming a Craft repository argument. Cover the distinction and remote failure with local Git repositories.

Assisted-by: Codex:gpt-6
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
Use branch-aware repository arguments for setup. Share the merged INI with CraftMaster, scope branch overrides to the corresponding checkout, and honor explicit test flags before parsing the configured boolean.

Forward reader diagnostics on stderr so they cannot break JSON decoding.

Assisted-by: Codex:gpt-6
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
@claucambra
claucambra force-pushed the work/mac-crafter-craftmaster-defaults branch from 260220f to ed94efb Compare November 26, 2026 15:04
Respect offline lookups and Craft Git URLs. Qualify a tag that shares its name with a branch, and keep explicit pins free of remote probes.

Assisted-by: Codex:gpt-6
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
Apply stock revisions to the default repositories, use the configured blueprint root for checkout overrides, and honor configured offline mode during registration.

Send reader diagnostics through the mac-crafter logger and include them in configuration errors.

Assisted-by: Codex:gpt-6
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
@sonarqubecloud

Copy link
Copy Markdown

@Rello

Rello commented Nov 27, 2026

Copy link
Copy Markdown
Collaborator

Hi,
what do you think? is this valid?

[P2] The canonical Nextcloud blueprint URL drops the configured revision. The default URL uses the old desktop-client-blueprints.git name. Passing --client-blueprints-git-url=https://github.com/nextcloud/craft-blueprints-nextcloud.git selects the same repository, but the literal URL comparison discards stable-35.0. Setup then registers master. Recognize both official names and add a regression test that checks the resulting registration argument. Build.swift, line 145 · Canonical repository

[P2] --offline --reconfigure-craft still runs git ls-remote. Both repository lookups receive only the INI’s General/WorkOffline value. With the checked-in configuration, an explicit --offline therefore triggers a remote lookup for stable-35.0 and can abort setup on a disconnected machine even when both checkouts already exist. The CLI flag reaches only the final client build. Use the effective offline setting for discovery and the Craft setup commands as well. Build.swift, line 310

[P2] A branch-only CraftMaster configuration falls back to master. For example, if the INI sets craft/craft-blueprints-nextcloud.branch = stable-35.0 and leaves .revision unset, the reader returns no client revision. Registration then emits |master|. The PR already writes .branch overrides itself, so reading that setting would make setup honor the same configuration it generates. Add a branch-only case that checks the registration argument. Configuration reader, line 70 · Fallback in Craft.swift, line 21

@i2h3 i2h3 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.

Thanks for this. Reading craftmaster.ini instead of keeping a second set of defaults in mac-crafter is the right direction. I'm requesting changes for one bug; the other inline comments are smaller changes I'd like to see before merge.

Blocking

  • With the client blueprint repo's current URL (craft-blueprints-nextcloud.git), mac-crafter silently registers master instead of the ini revision.

Requested before merge

  • The tests run the reader against a hand-written Config.py, not CraftMaster's real one.
  • The git ls-remote probe tells tags from branches, but the ini value is a branch today and Windows CI treats it as one.
  • buildTests is parsed a second time although CraftMaster already hands it to Craft.
  • The override code handles three cases that don't occur: a legacy craft-kde folder, a custom BlueprintRoot, and a craft/craft-blueprints-nextcloud blueprint, which Craft does not have.

Fixing the last three removes a large part of the new code and tests. Each inline comment names the tests that need to change with it.

How this was checked: I read the diff alongside the Craft source at 6e684481b (the CraftRevision in craftmaster.ini) and the CraftMaster source at 8a19d8f, and compared the blueprint refs with git ls-remote. I did not run mac-crafter or the reader.

Assisted by ClaudeCode:claude-opus-5-5

Resolve deferred settings against the selected Craft templates, preserve cached checkouts during inspection, and register the imported CraftMaster configuration module normally.

Use Craft mirrors for fresh probes and the configured Git remote for cached checkouts. Qualify confirmed tags before registration.

Assisted-by: Codex:gpt-6
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
Recognize the official Nextcloud blueprint URL aliases, honor configured branches, and forward offline mode to setup. Resolve blueprint refs without remote probes and let Craft consume configured test settings directly.

Scope the CLI overlay to the current KDE checkout and use the upstream CraftMaster parser as the test fixture.

Assisted-by: Codex:gpt-6
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
Ask Craft which checkout its KDE recipe uses after repository registration. Apply the requested branch only if the checkout matches, then pass the selected settings to dependency installation and the build.

Keep the checkout probe independent of the requested branch so a different checkout retains its configured ref.

Assisted-by: Codex:gpt-6
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
Restore CraftMaster’s generated BlueprintSettings.ini after temporary registration and checkout verification, including failed commands and Ctrl-C. Resolve the generated file from the configured target root.

Assisted-by: Codex:gpt-6
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
@claucambra
claucambra requested a review from i2h3 November 30, 2026 13:21
@claucambra
claucambra force-pushed the work/mac-crafter-craftmaster-defaults branch 2 times, most recently from 3802732 to 7bd48ad Compare November 30, 2026 13:51
Query the initialized Craft checkout for the effective build type. Verify the KDE checkout against its configured refs before creating an override scoped to the selected target. Keep the fixed INI keys in the reader and exercise it and output capture directly in tests.

Assisted-by: Codex:gpt-6
Assisted-by: Codex:gpt-6.2-sol
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
@claucambra
claucambra force-pushed the work/mac-crafter-craftmaster-defaults branch from 7bd48ad to 51b0a72 Compare November 30, 2026 13:57
…aster

Read blueprint URLs and refs from craftmaster.ini and let Craft apply the configured build type and test settings. Select the developer build type from the same configuration for the Xcode launcher.

Assisted-by: Codex:gpt-6.2-sol
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
@claucambra claucambra changed the title feat(mac-crafter): Defer to craftmaster config by default feat(mac-crafter): Build with craftmaster config Nov 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

os: 🍎 macOS Apple macOS, formerly also known as OS X

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants