Skip to content

Update deployment docs and refactor string formatting to strconv#7

Merged
ilramdhan merged 1 commit into
masterfrom
session/agent_1e6d5de6-be76-473e-bccd-b383e5a8aa6d
Mar 4, 2026
Merged

Update deployment docs and refactor string formatting to strconv#7
ilramdhan merged 1 commit into
masterfrom
session/agent_1e6d5de6-be76-473e-bccd-b383e5a8aa6d

Conversation

@ilramdhan
Copy link
Copy Markdown
Owner

@ilramdhan ilramdhan commented Mar 4, 2026

Update deployment docs and refactor string formatting to strconv

Description

Updates README.md with Railway deprecation note and fixes deployment links. Refactors string formatting from fmt.Sprintf to strconv.Itoa for consistency.

Type of Change

  • 📚 Documentation update
  • 🎨 Code style/formatting
  • ♻️ Code refactoring

Changes Made

  1. Update README.md with Railway deprecation note and fixed deployment links
  2. Replace fmt.Sprintf with strconv.Itoa for year/month/day formatting in holiday_repository.go
  3. Replace fmt.Sprintf with strconv.Itoa in pkg/client/client.go for consistency

How Has This Been Tested?

  • Manual testing on Linux

@ilramdhan ilramdhan requested a review from Copilot March 4, 2026 15:56
@ilramdhan ilramdhan self-assigned this Mar 4, 2026
@ilramdhan ilramdhan added bug Something isn't working documentation Improvements or additions to documentation enhancement New feature or request labels Mar 4, 2026
@chatgpt-codex-connector
Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

## Description
Updates README.md with Railway deprecation note and fixes deployment links. Refactors string formatting from fmt.Sprintf to strconv.Itoa for consistency.

## Type of Change
- [ ] 🐛 Bug fix
- [ ] ✨ New feature
- [ ] 💥 Breaking change
- [x] 📚 Documentation update
- [x] 🎨 Code style/formatting
- [x] ♻️ Code refactoring

## Changes Made
1. Update README.md with Railway deprecation note and fixed deployment links
2. Replace fmt.Sprintf with strconv.Itoa for year/month/day formatting in holiday_repository.go
3. Replace fmt.Sprintf with strconv.Itoa in pkg/client/client.go for consistency

## How Has This Been Tested?
- [ ] Unit tests
- [ ] Integration tests
- [x] Manual testing
- [ ] Other

**Test Configuration:**
* Go version: 1.x
* Operating System: Linux
@kilo-code-bot kilo-code-bot Bot force-pushed the session/agent_1e6d5de6-be76-473e-bccd-b383e5a8aa6d branch from 6eba886 to 9bfc1a0 Compare March 4, 2026 15:56
if filter.Year != nil {
whereConditions = append(whereConditions, "strftime('%Y', date) = ?")
args = append(args, fmt.Sprintf("%d", *filter.Year))
args = append(args, strconv.Itoa(*filter.Year))
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.

CRITICAL: Lost leading zero padding - SQLite strftime('%m') returns "01"-"12" but strconv.Itoa(1) returns "1", causing month filter to fail silently.

Suggested change
args = append(args, strconv.Itoa(*filter.Year))
args = append(args, fmt.Sprintf("%02d", *filter.Month))

if filter.Month != nil {
whereConditions = append(whereConditions, "strftime('%m', date) = ?")
args = append(args, fmt.Sprintf("%02d", *filter.Month))
args = append(args, strconv.Itoa(*filter.Month))
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.

CRITICAL: Lost leading zero padding - SQLite strftime('%m') returns "01"-"12" but strconv.Itoa(1) returns "1", causing month filter to fail silently.

Suggested change
args = append(args, strconv.Itoa(*filter.Month))
args = append(args, fmt.Sprintf("%02d", *filter.Month))

if filter.Day != nil {
whereConditions = append(whereConditions, "strftime('%d', date) = ?")
args = append(args, fmt.Sprintf("%02d", *filter.Day))
args = append(args, strconv.Itoa(*filter.Day))
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.

CRITICAL: Lost leading zero padding - SQLite strftime('%d') returns "01"-"31" but strconv.Itoa(1) returns "1", causing day filter to fail silently.

Suggested change
args = append(args, strconv.Itoa(*filter.Day))
args = append(args, fmt.Sprintf("%02d", *filter.Day))

Comment thread pkg/client/client.go
q := req.URL.Query()
if year != nil {
q.Add("year", fmt.Sprintf("%d", *year))
q.Add("year", strconv.Itoa(*year))
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.

WARNING: Inconsistent with server expectation - the server's SQLite query expects zero-padded month ("01"-"12") but this sends unpadded ("1"-"12"). This may cause filtering to fail.

Suggested change
q.Add("year", strconv.Itoa(*year))
q.Add("year", fmt.Sprintf("%d", *year))

Comment thread pkg/client/client.go
}
if month != nil {
q.Add("month", fmt.Sprintf("%d", *month))
q.Add("month", strconv.Itoa(*month))
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.

WARNING: Inconsistent with server expectation - the server's SQLite query expects zero-padded month ("01"-"12") but this sends unpadded ("1"-"12"). This may cause filtering to fail.

Suggested change
q.Add("month", strconv.Itoa(*month))
q.Add("month", fmt.Sprintf("%02d", *month))

@kilo-code-bot
Copy link
Copy Markdown
Contributor

kilo-code-bot Bot commented Mar 4, 2026

Code Review Summary

Status: 5 Issues Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 3
WARNING 2
SUGGESTION 0
Issue Details (click to expand)

CRITICAL

File Line Issue
internal/repository/holiday_repository.go 93 Lost leading zero padding - SQLite strftime('%m') returns "01"-"12" but strconv.Itoa(1) returns "1", causing month filter to fail silently
internal/repository/holiday_repository.go 98 Lost leading zero padding - Same issue as line 93
internal/repository/holiday_repository.go 103 Lost leading zero padding - SQLite strftime('%d') returns "01"-"31" but strconv.Itoa(1) returns "1", causing day filter to fail silently

WARNING

File Line Issue
pkg/client/client.go 105 Inconsistent with server expectation - the server's SQLite query expects zero-padded month but this sends unpadded
pkg/client/client.go 108 Inconsistent with server expectation - same issue as line 105
Other Observations (not in diff)

No other issues found in unchanged code.

Files Reviewed (3 files)
  • README.md - Documentation update only (no code issues)
  • internal/repository/holiday_repository.go - 3 critical issues
  • pkg/client/client.go - 2 warning issues

Note: This is a Go project using SQLite. The changes replace fmt.Sprintf with strconv.Itoa, which removes leading zero padding required by SQLite's strftime function.

@ilramdhan ilramdhan merged commit bb496bc into master Mar 4, 2026
4 of 5 checks passed
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates deployment documentation links/notes and refactors some integer-to-string formatting from fmt.Sprintf to strconv.Itoa in both the Go SDK client and the holiday repository query builder.

Changes:

  • Update README cloud deployment section with a Railway deprecation note and refreshed Railway/Render links.
  • Replace fmt.Sprintf("%d", ...) with strconv.Itoa(...) for query parameters in pkg/client.
  • Replace fmt.Sprintf with strconv.Itoa in holiday_repository filter argument construction.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
pkg/client/client.go Uses strconv.Itoa for year/month query parameters in the SDK client.
internal/repository/holiday_repository.go Refactors year/month/day filter argument formatting for SQLite strftime-based filtering.
README.md Updates cloud deployment documentation (Railway note/link, Render deploy link).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 96 to 99
if filter.Month != nil {
whereConditions = append(whereConditions, "strftime('%m', date) = ?")
args = append(args, fmt.Sprintf("%02d", *filter.Month))
args = append(args, strconv.Itoa(*filter.Month))
}
Copy link

Copilot AI Mar 4, 2026

Choose a reason for hiding this comment

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

strftime('%m', date) in SQLite returns a zero-padded month string (e.g., "01"). Switching from fmt.Sprintf("%02d", *filter.Month) to strconv.Itoa(*filter.Month) changes the bound parameter to "1", which will no longer match and breaks month filtering (including “this month” and month query param behavior). Consider restoring zero-padding or changing the SQL to compare integers (e.g., CAST(strftime('%m', date) AS INTEGER) = ?) and bind an int.

Copilot uses AI. Check for mistakes.
Comment on lines 101 to 104
if filter.Day != nil {
whereConditions = append(whereConditions, "strftime('%d', date) = ?")
args = append(args, fmt.Sprintf("%02d", *filter.Day))
args = append(args, strconv.Itoa(*filter.Day))
}
Copy link

Copilot AI Mar 4, 2026

Choose a reason for hiding this comment

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

Same issue as month: strftime('%d', date) returns a zero-padded day-of-month string (e.g., "05"). Using strconv.Itoa(*filter.Day) will bind "5" and the day filter won’t match. Use zero-padding again or compare numerically via CAST(strftime('%d', date) AS INTEGER) = ?.

Copilot uses AI. Check for mistakes.
Comment thread README.md

#### Railway
[![Deploy on Railway](https://railway.app/button.svg)](https://railway.app/template/your-template-id)
> **Note:** Railway telah menghentikan dukungan untuk template deployment gratis. Silakan gunakan opsi lain di bawah ini atau deploy secara manual.
Copy link

Copilot AI Mar 4, 2026

Choose a reason for hiding this comment

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

The README is otherwise written in English in this section, but the newly added Railway deprecation note is in Indonesian. For consistency and readability for the broader audience, consider translating this note to English or providing bilingual text.

Suggested change
> **Note:** Railway telah menghentikan dukungan untuk template deployment gratis. Silakan gunakan opsi lain di bawah ini atau deploy secara manual.
> **Note:** Railway has discontinued support for free deployment templates. Please use one of the options below or deploy manually. (Catatan: Railway telah menghentikan dukungan untuk template deployment gratis. Silakan gunakan opsi lain di bawah ini atau deploy secara manual.)

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working documentation Improvements or additions to documentation enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants