-
Notifications
You must be signed in to change notification settings - Fork 129
chore(api-public): return build metadata #3278
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
chore(api-public): return build metadata #3278
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
3 Skipped Deployments
|
How to use the Graphite Merge QueueAdd the label merge-queue to this PR to add it to the merge queue. You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
PR Review: Add Build Metadata to API PublicThank you for this contribution! This PR adds useful build metadata to the public API's metadata endpoint. Overall the implementation is solid, but I have some suggestions and concerns to address. Positives
Issues and Concerns1. Security Concern: Information Disclosure (Severity: Medium)The metadata endpoint exposes detailed build information including Git SHA, build timestamp, rustc version and host, and build profile. This information could aid attackers in identifying specific versions with known vulnerabilities or determining if a debug build is running. Recommendation: Consider whether all this information needs to be public or if some fields should be restricted to authenticated/admin users. Location: engine/packages/api-public/src/metadata.rs:13-21 2. Missing OpenAPI DocumentationThe /metadata endpoint is not included in the OpenAPI spec defined in router.rs. While the endpoint exists and is routed, it's not documented in the openapi paths macro. Recommendation: Add metadata::get_metadata to the OpenAPI paths list Location: engine/packages/api-public/src/router.rs:14-32 3. Potential Build Failure with Missing Git RepositoryThe build script uses vergen_gitcl::GitclBuilder::all_git() which may fail if the code is built from a tarball/zip without git history, the .git directory is missing, or git is not installed. Recommendation: Consider using .idempotent() or handling git metadata gracefully Location: engine/packages/api-public/build.rs:13 4. Testing: No Test CoverageThe metadata endpoint has no tests. While this is a simple endpoint, tests would verify the endpoint returns 200 OK, all expected fields are present, and the skip_auth behavior works correctly. Recommendation: Add integration tests for the metadata endpoint. 5. Minor: Inconsistent Vergen UsageThe rivet-env package uses vergen with default configuration while rivet-api-public uses it with specific features and git metadata. Recommendation: Consider whether rivet-env should be updated to use the same pattern for consistency. Additional Suggestions
Questions
SummaryThe implementation is functional and follows codebase conventions well. Main concerns are security (information disclosure), robustness (potential build failures without git), and documentation (missing OpenAPI spec and tests). Review Status: Changes Requested |
cc21086 to
727eeb1
Compare
Pull Request ReviewOverviewThis PR adds build metadata to the public API's Code Quality ✅Positive aspects:
Adherence to CLAUDE.md:
Potential Issues & Recommendations1. Error Handling Consistency (Minor)In 2. Missing Cargo Rebuild Triggers (Medium Priority)The build script does not tell Cargo to rebuild when git state changes. Without rebuild triggers for 3. Potential Build Failure in Non-Git Environments (High Priority)The 4. Compile-time Panic Risk (High Priority)In 5. API Documentation Missing (Low Priority)The Security Considerations ✅
Performance Considerations ✅
Test Coverage
|

No description provided.