fix(gateway): separate Forgejo token env #61
No reviewers
Labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Slipstream/auto_review!61
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/gateway-forgejo-token-env"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
ar-gatewayread the bot PAT fromAR_FORGEJO_TOKENinstead ofFORGEJO_TOKEN.FORGEJO_TOKENavailable for developer-local Forgejo tooling such as Kilo MCP/tea.Validation
nix develop -c cargo test -p ar-gateway forgejo_api_tokennix develop -c cargo fmt --all -- --checknix develop -c cargo clippy -p ar-gateway --all-targets -- -D warningsThis PR updates the
ar-gatewayto read the Forgejo API token fromAR_FORGEJO_TOKENinstead ofFORGEJO_TOKEN, allowing the latter to be used for developer-local tooling. The changes include updates to documentation, configuration files, and the main gateway code. The changes appear well-implemented and safe to merge.Walkthrough
AR_FORGEJO_TOKENfor the gateway, whileFORGEJO_TOKENremains for developer use.AR_FORGEJO_TOKEN. Added a helper functionforgejo_api_token_from_env_valuesto handle token retrieval.AR_FORGEJO_TOKEN.Pre-merge checks
@ -77,7 +77,7 @@ async fn main() -> Result<()> {);🟡 Warning: Ensure that the
forgejo_api_token_from_env_valuesfunction correctly handles cases whereAR_FORGEJO_TOKENis not set, as this could lead to runtime errors if not properly managed.Addressed by adding
crates/ar-gateway/tests/gateway_env.rs, an integration test that starts the gateway binary withWEBHOOK_SECRETandFORGEJO_BASE_URLset butAR_FORGEJO_TOKEN/FORGEJO_TOKENremoved. It asserts startup fails and the error namesAR_FORGEJO_TOKEN, so the missing-token case is now covered in a dedicated test file.This PR updates the
ar-gatewayto useAR_FORGEJO_TOKENfor the Forgejo API token, separating it fromFORGEJO_TOKENused for local tooling. The changes include updates to documentation, configuration files, and tests to reflect this new environment variable. The changes appear well-implemented and safe to merge.Walkthrough
AR_FORGEJO_TOKENinstead ofFORGEJO_TOKENfor the gateway.AR_FORGEJO_TOKEN.AR_FORGEJO_TOKENto start.AR_FORGEJO_TOKEN.AR_FORGEJO_TOKEN.AR_FORGEJO_TOKEN.AR_FORGEJO_TOKEN.Pre-merge checks
🟡 Warning: Ensure that the
forgejo_api_token_from_env_valuesfunction correctly handles cases whereAR_FORGEJO_TOKENis not set, as this is a critical change in how the token is retrieved.