External finishes#110
Conversation
|
@codex review |
|
Importing already installed Jar: |
There was a problem hiding this comment.
💡 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".
| fun managedHashes(): Set<String> = states.values | ||
| .flatMap { state -> listOfNotNull(state.installed?.sha256, state.staged?.sha256) } | ||
| .map(String::lowercase) | ||
| .toSet() |
There was a problem hiding this comment.
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 👍 / 👎.
| .mapNotNull { file -> | ||
| val hash = runCatching { HashType.SHA256.hash(file) }.getOrNull() ?: return@mapNotNull null | ||
| file.takeUnless { hash.lowercase() in managedHashes }?.let { UnrecognizedJar(it, hash) } |
There was a problem hiding this comment.
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 👍 / 👎.
|
@codex review |
There was a problem hiding this comment.
💡 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) { |
There was a problem hiding this comment.
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 👍 / 👎.
There was a problem hiding this comment.
It's always exposed bruh
|
@codex review |
There was a problem hiding this comment.
💡 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) |
There was a problem hiding this comment.
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 👍 / 👎.
No description provided.