Repository navigation
Conversation
…o plugins and invitation links
…in check and account changes
…d note the upgrade
There was a problem hiding this comment.
Code Health Improved
(1 files improve in Code Health)
Gates Passed
4 Quality Gates Passed
See analysis details in CodeScene
View Improvements
| File | Code Health Impact | Categories Improved |
|---|---|---|
| run.go | 8.93 → 8.96 | Complex Method |
Quality Gate Profile: Clean Code Collective
Install CodeScene MCP: safeguard and uplift AI-generated code. Catch issues early with our IDE extension and CLI tool.
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Load and validate the public URL cmd/alphone/run.go, cmd/alphone/mailconfig_test.go, .env.example, docs/src/content/docs/self-hosting/configuration.md, docs/src/content/docs/self-hosting/updates-and-backups.md, internal/graphres/graphres.go, sdk/sdk.go, test/features/features/operator-commands.feature |
ALPHONE_PUBLIC_URL is stored outside mail settings and parsed independently of SMTP configuration. A configured mail host still requires the URL. Tests and documentation cover URL validation and command behavior. |
Pass the URL to application consumers cmd/alphone/run.go, cmd/alphone/compose.go, cmd/alphone/mail.go, cmd/alphone/mailbuild_test.go, cmd/alphone/mailwiring_seam_test.go, cmd/alphone/mailwiring_test.go, cmd/alphone/publicurl_test.go |
The resolved URL is passed to plugins and mail construction. SMTP HELO uses the URL, and invitation tests check relative links when unset and absolute links when configured. |
Priority:
Estimated code review effort: 3 (Moderate) | ~20 minutes
Change: Feature · Severity of issue fixed: Medium
Sequence Diagram(s)
sequenceDiagram
participant Environment
participant loadPublicURL
participant composeSettings
participant graphResolver
participant Plugin
Environment->>loadPublicURL: ALPHONE_PUBLIC_URL
loadPublicURL->>composeSettings: parsed public URL
composeSettings->>graphResolver: publicURL
graphResolver->>Plugin: PublicURL dependency
Possibly related issues
Suggested reviewers: codescene-access
Merge Risk: 
Minimal · up to 3cb42
-
No material issue identified prevents merging after normal checks.
Pre-merge checks: 
4 · 
1
-
Failed checks: 1 warning Passed checks: 4 passed-
Check name Status Explanation Description Check Check skipped - CodeRabbit’s high-level summary is enabled. Title check The title clearly and concisely describes the main change: passing the public address to plugins and invitation links when no mail relay is configured. Linked Issues check Issue #288is the only directly linked, active issue. Its coding requirements are met at the reviewed head (3cb42de).
1. Read and validate ALPHONE_PUBLIC_URL without a mail relay [#288]: cmd/alphone/…Out of Scope Changes check The changes map to #288or support it. I found no unrelated change.
- run.go, compose.go, mail.go, mailbuild_test.go, mailconfig_test.go, mailwiring_seam_test.go: move the setting out of mailSettings…Full details: Linked Issues check
-
Explanation
Issue
#288is the only directly linked, active issue. Its coding requirements are met at the reviewed head (3cb42de).- Read and validate ALPHONE_PUBLIC_URL without a mail relay [
#288]: cmd/alphone/run.go adds loadPublicURL(env, mail). It calls gonsole.Parse(env, "PUBLIC_URL", "", parsePublicURL) on every load, whether or not SMTP_HOST is set. loadComposeSettings calls it and stores the result in composeSettings.publicURL. The same validator is used in all cases. - Hand the value to plugins without a relay [
#288]: cmd/alphone/compose.go sets sdk.Deps.PublicURL from cfg.publicURL, not cfg.mail.publicURL. The value no longer depends on the relay. - Relay still requires the setting [
#288]: loadPublicURL returns an error when mail.host != "" and the URL is empty. The error names PUBLIC_URL and SMTP_HOST. - Invitation link carries the full address [
#288]: cmd/alphone/run.go sets graphres PublicURL from settings.publicURL. internal/graphres/invite.go deliverInvite builds link with mail.ActivationLink(m.root.PublicURL, token). When Mailer is nil, the link is returned with delivered:false. The link is absolute when the URL is set. The no-relay invitation tests in cmd/alphone/mailwiring_test.go cover this case. - Configuration docs list the setting with the general settings [
#288]: The docs changes are described in the AI summary of docs/src/content/docs/self-hosting/configuration.md. I did not read that file directly, so this point rests on the summary.
Tests: the summary lists new or updated tests in cmd/alphone/publicurl_test.go, mailconfig_test.go, mailwiring_test.go and the operator-commands feature file. I did not run them. No test results are reported in the PR.
- Read and validate ALPHONE_PUBLIC_URL without a mail relay [
Full details: Out of Scope Changes check
-
Explanation
The changes map to
#288or support it. I found no unrelated change.- run.go, compose.go, mail.go, mailbuild_test.go, mailconfig_test.go, mailwiring_seam_test.go: move the setting out of mailSettings into the composed settings. The HELO value now comes from the same URL. This follows the move and keeps behavior for relay installs.
- run.go loadComposeSettings: the malformed-value refusal reaches serve, account commands, migrate, seed -yes and account:create-admin. These commands read the same composed settings. The refusal follows from the requirement that AlphOne validate the setting independently of the relay (
#288). The PR description states this behavior. - publicurl_test.go, operator-commands.feature: tests for the new behavior, including the account-role refusal path. They support the validation change.
- graphres.go, sdk.go: comment updates that match the new meaning of PublicURL.
- .env.example, configuration.md, updates-and-backups.md: documentation for the setting and the upgrade effect. Issue
#288asks for this listing.
The refusal scope for migrate and seed is a design choice beyond the issue's literal text. It is connected to validation with the same checks and is stated in the PR description, so I did not mark it out of scope.
-
Full details: Docstring Coverage
-
Explanation
Docstring coverage is 39.29% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 28 functions across 10 files. (4 skipped: 4 unsupported.)
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
-
Finishing Touches: 💡 1
-
📝 Generate docstrings: 💡
-
- Commit to this branch
- Create a new PR
🧪 Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Comment @coderabbitai help to get the list of available commands.
Code Review ✅ Approved🟡 Medium risk · Passing ALPHONE_PUBLIC_URL to plugins and invitation links without a relay changes redirect destinations; a stale value could send users to the wrong host. Reads VerificationRules No rules evaluated Functional validation Not enabledFor more verification details, comment OptionsAuto-apply is off → Gitar will not commit updates to this branch. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
[Medium impact] The reviewed changes are safe to merge, with no actionable issues identified.
|
Closes #288.
What
ALPHONE_PUBLIC_URLon every start, with the same checks, and hands it to plugins with or without a mail relay. A relay still requires it.serve, the account commands that take-as,migrate,seed -yesandaccount:create-admin, andalphone checknames it.Why
A plugin that sends people to Microsoft or Google to sign in needs the public address to bring them back. Today that only works on installs that also send mail.
Testing Instructions
Run the testing toolchain.
Summary by CodeRabbit
ALPHONE_PUBLIC_URLnow configures the application’s public address independently of mail settings and is available to plugins, even when no mail relay is configured.