Skip to content

Proper modpack generations - #509

Open
Skidamek wants to merge 291 commits into
mainfrom
feat/modpack-generations
Open

Proper modpack generations#509
Skidamek wants to merge 291 commits into
mainfrom
feat/modpack-generations

Conversation

@Skidamek

@Skidamek Skidamek commented Jul 30, 2026

Copy link
Copy Markdown
Owner

This PR rebuilds AutoModpack around immutable modpack generations and a shared content-addressed store.

Players can choose optional content, review changes, manage packs, restore preserved files, and repair installed packs offline. Server operators can safely publish or revert generations. Atomic updates, ownership records, and direct hash checks prevent partial installs and silent data loss.

The PR also improves the vanilla-style screens, all translations, storage cleanup, and end-to-end tests.

  • immutable generations
  • patch notes attached per generation
  • server rollback
  • remove nonModpackFilesToDelete
  • garbage collection
  • groups polish
  • client side UI/UX
    • server history listing with patch notes
    • download preview
    • better group selections by categories
  • human readable generation changelogs
  • autotester scenario

@Skidamek
Skidamek force-pushed the feat/modpack-generations branch from 6375016 to b5993ac Compare August 5, 2026 14:16
@Skidamek
Skidamek marked this pull request as ready for review August 13, 2026 13:54

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d6a470df5b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

public static final Path HOST_MODPACK_DIR = AUTOMODPACK_DIR.resolve("host-modpack");
public static final Path HOST_CONTENT_MODPACK_DIR = HOST_MODPACK_DIR.resolve("main");
public static final Path MODPACK_CONTENT_FILE = Path.of("automodpack-content.json");
public static final Path SERVER_CONFIG_FILE = AUTOMODPACK_DIR.resolve("server-config.json");

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Migrate the server configuration before renaming it

When upgrading an existing installation, the configuration remains at automodpack/automodpack-server.json, but all runtime readers now use this new filename and no repository code imports the legacy file. Consequently readOrCreate silently creates defaults, discarding custom groups, network settings, and security options; the current server setup documentation also still directs operators to the legacy filename. Preserve or migrate the existing configuration before switching paths.

Useful? React with 👍 / 👎.

Comment on lines +38 to +39
modpackExecutor = new ModpackExecutor();
var generation = modpackExecutor.publish();

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Initialize standalone generation metadata before publishing

When the standalone shadow JAR runs, loader Preload never initializes AM_VERSION, LOADER, LOADER_VERSION, or MC_VERSION, and this rewrite removed the standalone core-config read that previously populated them. Calling ModpackExecutor here therefore publishes a catalogue with all four metadata fields blank; notably, clients then treat the server AutoModpack version as unavailable and cannot honor version synchronization. Initialize these values from standalone configuration or artifact metadata before publishing.

Useful? React with 👍 / 👎.

Comment on lines +40 to +41
public static final Path SERVER_CERT_FILE = SERVER_DIR.resolve("certificate.crt");
public static final Path SERVER_PRIVATE_KEY_FILE = SERVER_DIR.resolve("private-key.pem");

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Preserve the existing TLS certificate during the path move

On the first start after an upgrade, the existing certificate and key remain at automodpack/.private/cert.crt and key.pem, while TLS setup checks only these new paths and generates a replacement pair when they are absent. This makes every client that pinned the previous self-signed certificate reject the server with a pin mismatch, and it silently ignores operator-installed CA certificates at the still-documented legacy location. Migrate the existing pair before allowing a new certificate to be generated.

Useful? React with 👍 / 👎.


private ModpackCandidate buildCandidate(Optional<GenerationStore.CurrentSnapshot> previous) throws IOException, CandidateBuildException {
validateConfiguration();
prepareDirectories();

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Reuse the legacy modpack ID for the root generation

On the first generation after upgrading, the new generation store has no current pointer even though host-modpack/automodpack-content.json contains the previously published modpack ID. This branch generates a random replacement instead of importing that identity, and the only legacy-catalogue handling later deletes the old file. Existing clients therefore see the same server as a different modpack, lose seamless update continuity, and must install/manage a duplicate pack; seed the root generation from the legacy catalogue ID before generating a new one.

Useful? React with 👍 / 👎.

@Skidamek
Skidamek force-pushed the feat/modpack-generations branch from 333c9db to bdd6bfb Compare August 13, 2026 19:47
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.

1 participant