Repository navigation
update site for environment-agent model and m2 release - #25
Conversation
Assisted-By: Claude (Anthropic) Signed-off-by: Gloria Ciavarrini <gciavarrini@redhat.com>
Assisted-By: Claude (Anthropic) Signed-off-by: Gloria Ciavarrini <gciavarrini@redhat.com>
Assisted-By: Claude (Anthropic) Signed-off-by: Gloria Ciavarrini <gciavarrini@redhat.com>
Assisted-By: Claude (Anthropic) Signed-off-by: Gloria Ciavarrini <gciavarrini@redhat.com>
Rewrite relative parent-directory links to point at the source repository instead of the generated site. Assisted-By: Claude (Anthropic) Signed-off-by: Gloria Ciavarrini <gciavarrini@redhat.com>
Assisted-By: Claude (Anthropic) Signed-off-by: Gloria Ciavarrini <gciavarrini@redhat.com>
Assisted-by: Claude (Anthropic) Signed-off-by: Gloria Ciavarrini <gciavarrini@redhat.com>
PR Summary by QodoDocument environment-agent workflows and m2 local setup
AI Description
Diagram
High-Level Assessment
Files changed (10)
|
Code Review by Qodo
1.
|
There was a problem hiding this comment.
Hey - I've found 7 issues
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path="content/docs/user-guide/policies.md" line_range="139" />
<code_context>
catalog_item_id: small-vm
user_values:
- - path: metadata
+ - resource: main
+ path: metadata
value:
</code_context>
<issue_to_address>
**Catalog fields are unavailable**
When a reader follows the policy guide's catalog-and-instance example using the updated schema, the catalog-item example leaves `fields` at the top level instead of under `spec.resources[].fields`, so the `main` resource does not expose the region label in `input.spec` and the policy rejects placement. The instance guide also describes validation against an unscoped fields list, leaving the examples inconsistent with the updated schema.
Update the catalog-item field examples to define fields under a named `spec.resources[]` resource, and make the instance validation description resource-scoped.
Also at `content/docs/user-guide/catalog-item-instances.md:61-62`, `content/docs/user-guide/catalog-items.md:36-37`.
</issue_to_address>
### Comment 2
<location path="content/docs/getting-started/register-another-provider.md" line_range="41" />
<code_context>
```bash
-curl -s http://localhost:8080/api/v1alpha1/providers | jq
+curl -s http://localhost:8080/api/v1alpha1/agents | jq
```
</code_context>
<issue_to_address>
**Expected agents are not registered**
When a reader follows the tutorial on the environment-agent architecture, the guide starts a KubeVirt service-provider container, which registers with the Service Provider Manager, but verifies agents through `/agents` and selects the provider names as agents. The setup therefore does not register the expected environment agents, so verification and placement fail when those names are absent from the agent list.
Update the tutorial to start and register the environment agents with the Agent Manager, and ensure the verification and policy use their registered names.
Also at `content/docs/getting-started/register-another-provider.md:61`, `content/docs/getting-started/register-another-provider.md:65`, `content/docs/getting-started/architecture.md:51`.
</issue_to_address>
### Comment 3
<location path="content/docs/getting-started/create-placement-policy.md" line_range="28" />
<code_context>
main := {
"rejected": false,
- "selected_provider": "kubevirt-service-provider"
+ "selected_agent": "local-agent"
}
```
</code_context>
<issue_to_address>
**Policy selects an unknown agent**
When a reader uses the example policy with the documented KubeVirt setup, the policy selects `local-agent`, but the documented setup registers the agent as `kubevirt-service-provider`. Placement cannot resolve the selected name and fails.
Set `selected_agent` to the registered agent name, `kubevirt-service-provider`.
</issue_to_address>
### Comment 4
<location path="content/blog/sovereignty-rehydrate-demo/index.md" line_range="133" />
<code_context>
+ some a in agents
+ a.health_status == "ready"
+ service_type in a.service_types
+ a.environment == requested_region
]
</code_context>
<issue_to_address>
**Sovereignty lab rejects agents**
When a reader follows the linked lab setup and sets region only through the documented `SP_REGION` provider configuration, the policy matches `a.environment`, but the lab instructions configure `SP_REGION` on workload providers, not the agent environment; the configured agents do not match the requested region and the policy rejects placement.
Update the lab instructions to configure each environment agent's `environment` value to match the policy's region label, or change the policy to use metadata that the documented setup actually provides.
</issue_to_address>
### Comment 5
<location path="layouts/shortcodes/remoteMD.html" line_range="9-12" />
<code_context>
+ {{/* Derive the GitHub browse URL from the raw-content URL so relative
+ cross-references inside the fetched Markdown can be rewritten to
+ point at the source repository instead of the generated site. */}}
+ {{ $browseBase = replaceRE "raw\\.githubusercontent\\.com/([^/]+)/([^/]+)/([^/]+)" "github.com/$1/$2/blob/$3" $rawBase }}
{{ end }}
{{ $resource := resources.GetRemote $url }}
</code_context>
<issue_to_address>
**Cross-references target wrong directory**
When a fetched enhancement contains a relative parent-directory link, the rewrite uses a browse base without the `/enhancements` suffix, so `../` links point to the repository root rather than the enhancements directory and GitHub returns a missing page.
Include `/enhancements` in the browse base used to rewrite these links.
</issue_to_address>
### Comment 6
<location path="layouts/shortcodes/remoteMD.html" line_range="9" />
<code_context>
+ {{/* Derive the GitHub browse URL from the raw-content URL so relative
+ cross-references inside the fetched Markdown can be rewritten to
+ point at the source repository instead of the generated site. */}}
+ {{ $browseBase = replaceRE "raw\\.githubusercontent\\.com/([^/]+)/([^/]+)/([^/]+)" "github.com/$1/$2/blob/$3" $rawBase }}
{{ end }}
{{ $resource := resources.GetRemote $url }}
</code_context>
<issue_to_address>
**GitHub links are relative**
When fetched enhancement Markdown contains a relative parent-directory link, `replaceRE` builds `$browseBase` without an `https://` scheme, so rewritten destinations are treated as paths on the documentation site instead of links to GitHub sources.
Include the `https://` scheme in the derived browse URL.
</issue_to_address>
### Comment 7
<location path="content/docs/getting-started/register-another-provider.md" line_range="68" />
<code_context>
}
- idx := round(rand.intn("seed", count(providers)))
+ idx := round(rand.intn("seed", count(agents)))
```
</code_context>
<issue_to_address>
**Random policy always selects same agent**
When the example policy is used while multiple agents are eligible, every evaluation with the fixed seed and the same agent count returns the same index, so concurrent instance requests select the same agent instead of distributing placements; callers see one agent receive all the deployments.
Use a request-specific seed or a scheduling mechanism that actually varies agent selection across requests.
</issue_to_address>Sourcery assessment
Approval pending. 7 findings to address first.
Blocking findings: content/docs/user-guide/policies.md:139, content/docs/getting-started/register-another-provider.md:41, content/docs/getting-started/create-placement-policy.md:28, content/blog/sovereignty-rehydrate-demo/index.md:133, layouts/shortcodes/remoteMD.html:12, and 2 more
Signed-off-by: Gloria Ciavarrini <gciavarrini@redhat.com>
Revert the /providers URL change and add a note that this page describes the old service-provider model. Signed-off-by: Gloria Ciavarrini <gciavarrini@redhat.com> Assisted-by: Claude (Anthropic)
y-first
left a comment
There was a problem hiding this comment.
Good sweep — terminology, schema, and Rego examples are consistent across files. A few correctness gaps and one unexplained new field to address before merge.
|
|
||
| To use the m2 release images, add the following to your `.env` file: | ||
|
|
||
| ```bash |
There was a problem hiding this comment.
[MEDIUM] Bash code block implies shell commands, not file writes
Using ```bash for lines that must be appended to .env is ambiguous — a reader may run them in the terminal, where they silently set shell-local vars that don't persist to the file. Suggest ```text or ```ini and an explicit "append to .env" instruction:
CONTROL_PLANE_VERSION=m2
ENVIRONMENT_AGENT_VERSION=m2
DCM_UI_VERSION=m2
Also: please confirm ENVIRONMENT_AGENT_VERSION is the exact variable name used in .env.example and the compose file — if the name differs, the pin silently has no effect.
There was a problem hiding this comment.
changed to ini in 78b17de.
ENVIRONMENT_AGENT_VERSION is the exact name in .env.example and compose.yaml.
| @@ -161,16 +170,16 @@ main := {"rejected": false, "selected_provider": provider} if { | |||
|
|
|||
| The `main` rule must return an object with the following fields: | |||
There was a problem hiding this comment.
[MEDIUM] environment_constraints is listed but never explained or exampled
The agent_constraints row introduces environment_constraints ("list of environment labels") as a new sub-field not present in the old service_provider_constraints. There is no example, no description of the expected format, and no explanation of how it relates to the agent environment field.
A reader who needs to restrict placement to agents in a specific environment has nothing to go on. At minimum, add a short example alongside allow_list / patterns, or link to a section that shows the full agent_constraints shape.
There was a problem hiding this comment.
Expanded the description in 78b17de: it now says the values are matched against each agent's environment field and intersected across policies.
Add agent name verification note to create-placement-policy. Use ini block for .env values in local-setup. Clarify environment_constraints in policy output table. Add setup callout for AGENT_ENVIRONMENT in sovereignty blog post. Signed-off-by: Gloria Ciavarrini <gciavarrini@redhat.com> Assisted-by: Claude (Anthropic)
| {{/* Derive the GitHub browse URL from the raw-content URL so relative | ||
| cross-references inside the fetched Markdown can be rewritten to | ||
| point at the source repository instead of the generated site. */}} | ||
| {{ $browseBase = replaceRE "raw\\.githubusercontent\\.com/([^/]+)/([^/]+)/([^/]+)" "github.com/$1/$2/blob/$3" $rawBase }} |
There was a problem hiding this comment.
Another issue:
- Line 9 derives $browseBase.
- Lines 24-29 rewrite only links beginning with ../.
It needs to:
- Include /enhancements in the browse base.
- Rewrite root-absolute links beginning with /enhancements/, not just ../.
This issue results in the following with a local hugo server test:
http://localhost:1313/docs/enhancements/catalog-item-schema/
- Contains /enhancements/declarative-api/declarative-api.md
- Target returns HTTP 404.
http://localhost:1313/docs/enhancements/user-flows/
- Contains /enhancements/environment-agent/environment-agent.md
- Target returns HTTP 404.
|
/lgtm - pending open comments |
Some enhancement files use root-absolute paths instead of relative ../. Rewrite both patterns to GitHub browse URLs. Signed-off-by: Gloria Ciavarrini <gciavarrini@redhat.com> Assisted-by: Claude (Anthropic)
|
/lgtm |
Update documentation to reflect the environment-agent model replacing the service-provider model, and pin
m2release images.Catalog items now use the multi-resource schema (
spec.resources),user_valuesare resource-scoped, and placement policies outputselected_agentwith agent_constraints.Rego examples call the
/agentsAPI and filterservice_typeclient-side.Architecture diagrams show the Agent Manager and environment agent flow.
Also fixes broken cross-reference links in remote enhancement pages (remoteMD shortcode) and adds the
.envcopy step to thelocal-setupquick start.Fixes
FLPATH-4969
Summary by Sourcery
Update the site documentation and examples for environment-agent based placement, multi-resource catalog items, and m2 release setup.
New Features:
Bug Fixes:
Enhancements:
.envand optionally using pinned m2 release images.Documentation: