Skip to content

deps(flare): Add registry entry for flare manifest endpoint #5610

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: feature/q-lsp-chat
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import com.fasterxml.jackson.annotation.JsonProperty
import com.fasterxml.jackson.databind.DeserializationFeature
import com.fasterxml.jackson.module.kotlin.jacksonObjectMapper
import com.fasterxml.jackson.module.kotlin.readValue
import com.intellij.openapi.util.registry.Registry
import org.jetbrains.annotations.VisibleForTesting
import software.aws.toolkits.core.utils.deleteIfExists
import software.aws.toolkits.core.utils.error
Expand All @@ -28,8 +29,12 @@ class ManifestFetcher(
private val mapper = jacksonObjectMapper().apply { configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false) }
private val logger = getLogger<ManifestFetcher>()

private const val DEFAULT_MANIFEST_URL =
"https://aws-toolkit-language-servers.amazonaws.com/qAgenticChatServer/0/manifest.json"
private val DEFAULT_MANIFEST_URL = getManifestEndpoint()

private fun getManifestEndpoint(): String {
val endpoint = Registry.get("amazon.q.flare.endpoint").asString()
return endpoint.ifBlank { "https://aws-toolkit-language-servers.amazonaws.com/qAgenticChatServer/0/manifest.json" }
}
Comment on lines +32 to +37
Copy link
Contributor

Choose a reason for hiding this comment

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

value will be read on class init

Suggested change
private val DEFAULT_MANIFEST_URL = getManifestEndpoint()
private fun getManifestEndpoint(): String {
val endpoint = Registry.get("amazon.q.flare.endpoint").asString()
return endpoint.ifBlank { "https://aws-toolkit-language-servers.amazonaws.com/qAgenticChatServer/0/manifest.json" }
}
private val DEFAULT_MANIFEST_URL
get() = getManifestEndpoint()
private fun getManifestEndpoint(): String {
val endpoint = Registry.get("amazon.q.flare.endpoint").asString()
return endpoint.ifBlank { "https://aws-toolkit-language-servers.amazonaws.com/qAgenticChatServer/0/manifest.json" }
}

should probably just delete DEFAULT_MANIFEST_URL and only use the method


private val DEFAULT_MANIFEST_PATH: Path = getToolkitsCommonCacheRoot()
.resolve("aws")
Expand Down
3 changes: 3 additions & 0 deletions plugins/amazonq/src/main/resources/META-INF/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,9 @@
restartRequired="true"/>
<registryKey key="inline.completion.rem.dev.use.rhizome" description="Defined by IntelliJ. Used for Amazon Q to display suggestions on remote."
defaultValue="false" restartRequired="true"/>
<registryKey defaultValue=""
description="Endpoint to use to download flare artifacts"
key="amazon.q.flare.endpoint"/>
</extensions>

<extensionPoints>
Expand Down
Loading