feat(projectbuild): timestamp tokens for GitHub single-release tags#99
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
PR Review: Timestamp Tokens for GitHub Single-Release TagsSummaryThis PR adds four new date/time tokens ( ✅ Strengths
🔍 Code Quality ObservationsGood Practices
Potential Improvements1. String Replacement Order Issue (Minor) The .Replace("{Date}", date ?? string.Empty) // yyyy.MM.dd
.Replace("{DateTime}", dateTime ?? string.Empty) // yyyy.MM.dd.HHmmssIf a template contains Recommendation: Replace longer tokens first: return template
.Replace("{DateTime}", dateTime ?? string.Empty)
.Replace("{UtcDateTime}", utcDateTime ?? string.Empty)
.Replace("{Timestamp}", timestamp ?? string.Empty)
.Replace("{UtcTimestamp}", utcTimestamp ?? string.Empty)
.Replace("{Date}", date ?? string.Empty)
.Replace("{UtcDate}", utcDate ?? string.Empty)
// ... rest of replacements2. Potential Race Condition The timestamp tokens are generated once at the beginning (InvokeProjectBuildCommand.cs:262-269), but in PerProject mode, multiple releases could be created over time if they're slow. This means:
Analysis: This is probably acceptable behavior (consistent timestamps across a batch), but worth documenting if intentional. 3. No Input Validation The Risk: Very low - DateTime.Now/UtcNow are always valid, but defensive programming might catch edge cases. 🧪 Test CoverageIssue: No unit tests found for the Recommendation: Add tests covering:
Example test structure: [Fact]
public void ApplyTemplate_WithDateTimeTokens_ReplacesCorrectly()
{
var result = ApplyTemplate(
"{DateTime}-{Date}",
project: "Test",
version: "1.0.0",
// ... other params
dateTime: "2026.02.11.085456",
date: "2026.02.11"
);
Assert.Equal("2026.02.11.085456-2026.02.11", result);
}🔒 Security AssessmentNo security concerns identified:
⚡ Performance ConsiderationsNo performance issues:
📋 Additional Observations
📝 Recommendations SummaryBefore Merge:
Post-Merge (Low Priority): ✅ Overall AssessmentRecommendation: Approve with minor fix This is a well-implemented feature that solves a real problem (collision-free tags in single-release mode). The code is clean and follows existing patterns. The main issue is the potential token replacement order bug, which should be fixed before merge. Test coverage would be nice to have but isn't blocking given the simplicity of the change. Quality: 8/10 |
Adds date/time token support for GitHub tag/release templates in Invoke-ProjectBuild:\n- {DateTime}, {UtcDateTime} => yyyy.MM.dd.HHmmss\n- {Timestamp}, {UtcTimestamp} => yyyyMMddHHmmss\n\nThis allows Single mode tags to be date-based and unique per run (without depending on GitHubPrimaryProject version).