Skip to content

✨feat:enhancement Replace all WORKLOAD_MANAGER_ADDR with WORKLOAD_MANAGER_URL #192

Merged
volcano-sh-bot merged 9 commits intovolcano-sh:mainfrom
katara-Jayprakash:pr-174
Feb 6, 2026
Merged

✨feat:enhancement Replace all WORKLOAD_MANAGER_ADDR with WORKLOAD_MANAGER_URL #192
volcano-sh-bot merged 9 commits intovolcano-sh:mainfrom
katara-Jayprakash:pr-174

Conversation

@katara-Jayprakash
Copy link
Copy Markdown
Member

@katara-Jayprakash katara-Jayprakash commented Jan 31, 2026

What type of PR is this?

What this PR does / why we need it:

Which issue(s) this PR fixes:
Fixes #174

Special notes for your reviewer:

Does this PR introduce a user-facing change?:


Signed-off-by: katara-Jayprakash <katarajayprakash@icloud.com>
Signed-off-by: katara-Jayprakash <katarajayprakash@icloud.com>
Signed-off-by: katara-Jayprakash <katarajayprakash@icloud.com>
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @katara-Jayprakash, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request primarily focuses on a refactoring effort to standardize the naming convention for the workload manager's address environment variable. The variable WORKLOAD_MANAGER_ADDR has been consistently renamed to WORKLOAD_MANAGER_URL across various components, including Kubernetes deployment manifests, Go application code, and both Go and Python end-to-end test suites. This change improves clarity and consistency in how the workload manager's endpoint is referenced throughout the system.

Highlights

  • Environment Variable Renaming: The environment variable WORKLOAD_MANAGER_ADDR has been consistently renamed to WORKLOAD_MANAGER_URL across the codebase for improved clarity and consistency.
  • Kubernetes Configuration Update: The Kubernetes deployment manifest for agentcube-router has been updated to reflect the new WORKLOAD_MANAGER_URL environment variable.
  • Test Suite Refactoring: Both Go and Python end-to-end test files have been refactored to use the updated WORKLOAD_MANAGER_URL environment variable, ensuring test compatibility with the naming change.
  • Minor Formatting Improvements: Several minor formatting adjustments, including whitespace and multiline string syntax, have been applied to shell and Python scripts.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@katara-Jayprakash katara-Jayprakash changed the title Pr 174 ✨feat:enhancement Replace all WORKLOAD_MANAGER_ADDR with WORKLOAD_MANAGER_URL Jan 31, 2026
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request consistently renames the WORKLOAD_MANAGER_ADDR environment variable to WORKLOAD_MANAGER_URL across the codebase, which is a good clarification. The changes in YAML configurations, Go code, and test scripts are all correct and aligned with this goal. I've identified some areas in the Go test files with duplicated code for environment variable setup and have provided suggestions to refactor this for better maintainability.

Comment on lines 63 to 70
os.Setenv("REDIS_ADDR", "localhost:6379")
os.Setenv("REDIS_PASSWORD", "test-password")
os.Setenv("WORKLOAD_MANAGER_ADDR", "http://localhost:8080")
os.Setenv("WORKLOAD_MANAGER_URL", "http://localhost:8080")
defer func() {
os.Unsetenv("REDIS_ADDR")
os.Unsetenv("REDIS_PASSWORD")
os.Unsetenv("WORKLOAD_MANAGER_ADDR")
os.Unsetenv("WORKLOAD_MANAGER_URL")
}()
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

This block for setting and unsetting environment variables is repeated in multiple tests. To improve maintainability and reduce code duplication, you can use the existing setupEnv and teardownEnv helper functions.

Suggested change
os.Setenv("REDIS_ADDR", "localhost:6379")
os.Setenv("REDIS_PASSWORD", "test-password")
os.Setenv("WORKLOAD_MANAGER_ADDR", "http://localhost:8080")
os.Setenv("WORKLOAD_MANAGER_URL", "http://localhost:8080")
defer func() {
os.Unsetenv("REDIS_ADDR")
os.Unsetenv("REDIS_PASSWORD")
os.Unsetenv("WORKLOAD_MANAGER_ADDR")
os.Unsetenv("WORKLOAD_MANAGER_URL")
}()
setupEnv()
defer teardownEnv()

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@katara-Jayprakash pelease help fix this.

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.

i fixed them and additionally refactor the another testCases

Comment on lines 27 to 35
// Set required environment variables for tests
os.Setenv("REDIS_ADDR", "localhost:6379")
os.Setenv("REDIS_PASSWORD", "test-password")
os.Setenv("WORKLOAD_MANAGER_ADDR", "http://localhost:8080")
os.Setenv("WORKLOAD_MANAGER_URL", "http://localhost:8080")
defer func() {
os.Unsetenv("REDIS_ADDR")
os.Unsetenv("REDIS_PASSWORD")
os.Unsetenv("WORKLOAD_MANAGER_ADDR")
os.Unsetenv("WORKLOAD_MANAGER_URL")
}()
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

This block for setting and unsetting environment variables is repeated across all tests in this file. To improve maintainability and reduce boilerplate, consider creating a helper function that sets the environment variables and uses t.Cleanup for teardown.

For example, you could add:

func setupTestEnv(t *testing.T) {
    t.Helper()
    os.Setenv("REDIS_ADDR", "localhost:6379")
    os.Setenv("REDIS_PASSWORD", "test-password")
    os.Setenv("WORKLOAD_MANAGER_URL", "http://localhost:8080")
    t.Cleanup(func() {
        os.Unsetenv("REDIS_ADDR")
        os.Unsetenv("REDIS_PASSWORD")
        os.Unsetenv("WORKLOAD_MANAGER_URL")
    })
}

And then call setupTestEnv(t) at the start of each test.

For a more direct improvement, you can replace the defer with t.Cleanup which is the modern, idiomatic way to handle test cleanup in Go.

Suggested change
// Set required environment variables for tests
os.Setenv("REDIS_ADDR", "localhost:6379")
os.Setenv("REDIS_PASSWORD", "test-password")
os.Setenv("WORKLOAD_MANAGER_ADDR", "http://localhost:8080")
os.Setenv("WORKLOAD_MANAGER_URL", "http://localhost:8080")
defer func() {
os.Unsetenv("REDIS_ADDR")
os.Unsetenv("REDIS_PASSWORD")
os.Unsetenv("WORKLOAD_MANAGER_ADDR")
os.Unsetenv("WORKLOAD_MANAGER_URL")
}()
// Set required environment variables for tests
os.Setenv("REDIS_ADDR", "localhost:6379")
os.Setenv("REDIS_PASSWORD", "test-password")
os.Setenv("WORKLOAD_MANAGER_URL", "http://localhost:8080")
t.Cleanup(func() {
os.Unsetenv("REDIS_ADDR")
os.Unsetenv("REDIS_PASSWORD")
os.Unsetenv("WORKLOAD_MANAGER_URL")
})

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

ditto

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.

fixed!

@katara-Jayprakash
Copy link
Copy Markdown
Member Author

katara-Jayprakash commented Jan 31, 2026

@YaoZengzeng @hzxuzhonghu @acsoto have a look at it sir! thanx

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Jan 31, 2026

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 50.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 35.77%. Comparing base (845b798) to head (d1f85ba).
⚠️ Report is 44 commits behind head on main.

Files with missing lines Patch % Lines
pkg/router/session_manager.go 50.00% 1 Missing ⚠️
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #192      +/-   ##
==========================================
+ Coverage   35.60%   35.77%   +0.16%     
==========================================
  Files          29       29              
  Lines        2533     2549      +16     
==========================================
+ Hits          902      912      +10     
- Misses       1505     1511       +6     
  Partials      126      126              
Flag Coverage Δ
unittests 35.77% <50.00%> (+0.16%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@acsoto
Copy link
Copy Markdown
Member

acsoto commented Feb 3, 2026

LGTM

Signed-off-by: katara-Jayprakash <katarajayprakash@icloud.com>
Signed-off-by: katara-Jayprakash <katarajayprakash@icloud.com>
Signed-off-by: katara-Jayprakash <katarajayprakash@icloud.com>
Signed-off-by: katara-Jayprakash <katarajayprakash@icloud.com>
Signed-off-by: katara-Jayprakash <katarajayprakash@icloud.com>
Signed-off-by: katara-Jayprakash <katarajayprakash@icloud.com>
os.Setenv("REDIS_ADDR", "localhost:6379")
os.Setenv("REDIS_PASSWORD", "test-password")
os.Setenv("WORKLOAD_MANAGER_ADDR", "http://localhost:8080")
setupEnv()
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.

directly calling setupEnv make more sense in all test


func TestNewServer(t *testing.T) {
// Set required environment variables for tests
func setupTestEnv(t *testing.T) {
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.

trying to refactoring the code by adding/implementing the setUpTestEnv().

@YaoZengzeng
Copy link
Copy Markdown
Member

/lgtm
/approve

@katara-Jayprakash
Copy link
Copy Markdown
Member Author

/lgtm /approve

@LiZhenCheng9527 @hzxuzhonghu got clarifications and now we can merge it. thanx

@hzxuzhonghu
Copy link
Copy Markdown
Member

/approve

@volcano-sh-bot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: hzxuzhonghu, YaoZengzeng

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@volcano-sh-bot volcano-sh-bot merged commit aac8acd into volcano-sh:main Feb 6, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Replace all WORKLOAD_MANAGER_ADDR with WORKLOAD_MANAGER_URL

6 participants