Skip to content

External finishes#110

Open
SamuSonoIo wants to merge 6 commits into
masterfrom
external-finishes
Open

External finishes#110
SamuSonoIo wants to merge 6 commits into
masterfrom
external-finishes

Conversation

@SamuSonoIo

Copy link
Copy Markdown
Member

No description provided.

@SamuSonoIo

Copy link
Copy Markdown
Member Author

@codex review

@SamuSonoIo

Copy link
Copy Markdown
Member Author

Importing already installed Jar:
/pp external import github viaversion ViaVersion ViaVersion ViaVersion ViaVersion.jar
/pp external import geysermc floodgate floodgate spigot floodgate-spigot.jar

@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: 59a59903ad

ℹ️ 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".

Comment on lines +163 to +166
fun managedHashes(): Set<String> = states.values
.flatMap { state -> listOfNotNull(state.installed?.sha256, state.staged?.sha256) }
.map(String::lowercase)
.toSet()

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 Ignore stale external states when collecting hashes

When a user removes an entry from external-plugins.yml and reloads, reload() rebuilds configs but never purges states whose IDs are no longer configured. Returning hashes from every saved state here makes /pp recognize and /pp list --all continue to treat the removed plugin's JAR as externally managed even though no external command can manage it anymore, blocking users from recognizing or listing the now-unmanaged file. Filter this to configured IDs or purge removed states during reload.

Useful? React with 👍 / 👎.

Comment on lines +214 to +216
.mapNotNull { file ->
val hash = runCatching { HashType.SHA256.hash(file) }.getOrNull() ?: return@mapNotNull null
file.takeUnless { hash.lowercase() in managedHashes }?.let { UnrecognizedJar(it, hash) }

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 Skip staged-update leftovers in list --all

When a marketplace update is staged, LocalPluginCache.installUpdate replaces the cache entry with the new JAR hash in plugins/update, while the old [PP] ... JAR remains in plugins/ until restart. Because this scan excludes only hashes, that still-managed old JAR is shown as unrecognized and the RECOGNIZE button can add the old version back to plugins.json; exclude managed downloaded filenames here as recognizeAll already does.

Useful? React with 👍 / 👎.

@SamuSonoIo

Copy link
Copy Markdown
Member Author

@codex review

@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: d209ffd5b9

ℹ️ 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".


val hash = HashType.SHA256.hash(pluginFile)
val resolvedArtifact = runCatching { providers.getValue(config.provider).resolve(config) }.getOrNull()
val installed = if (resolvedArtifact?.sha256?.equals(hash, ignoreCase = true) == true) {

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 Preserve resolved metadata when imports lack remote hashes

When importing a GitHub external whose release asset does not expose a SHA-256 digest, resolvedArtifact?.sha256 is null, so this falls into the synthetic imported:<hash> state even if the local JAR is the latest asset. The GitHub provider explicitly allows a null hash, and ExternalArtifactState.matches() can still treat installed downloads as current by artifact id/version when the artifact hash is null; with this import state, the next /pp external check reports an update and /pp external update re-downloads the same release unnecessarily.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

It's always exposed bruh

@SamuSonoIo

Copy link
Copy Markdown
Member Author

@codex review

@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: 94264b3d6a

ℹ️ 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".

removeState(id)
}
if (destination.exists()) return failure("${destination.path} already exists and is not tracked as an external plugin")
if (destination.exists()) return adoptInstalled(config, destination)

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 Avoid adopting arbitrary jars during install

When plugins/<configured file> already exists (for example, a stale manual install or a different JAR with the same name), /pp external install <id> now records that local file as the installed external plugin instead of downloading the provider artifact. The new external import commands are the explicit path for tracking an existing JAR; install should either fail as before or only adopt after verifying the file matches the resolved artifact, otherwise the command can report success while leaving an outdated or unrelated JAR in place until the user happens to run an update.

Useful? React with 👍 / 👎.

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