Conversation
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (1)
Note
|
| Cohort / File(s) | Summary |
|---|---|
Go version & toolchain \.github/workflows/build-to-bin.yml, \.github/workflows/ci.yml, src/find_all_files/go.mod, src/lokalise_upload/go.mod, src/store_translation_paths/go.mod |
Updated Go language/toolchain from 1.25 / go1.25.6 → 1.26 / go1.26.0. |
Composite action (platform detection) action.yml |
Added Detect platform step, changed os_platform default to empty, added auto-detection and validation mapping from RUNNER_OS/RUNNER_ARCH, and propagated PLATFORM output to subsequent steps; updated validation error behavior. |
CI workflows & actions \.github/workflows/codeql.yml, \.github/workflows/ci.yml |
Upgraded checkout/action versions (checkout@v6) and bumped Go setup versions in CI workflows; removed header comments in CodeQL workflow. |
Documentation README.md |
Added CI badge, updated Push action reference version, and clarified os_platform auto-detection and platform description. |
.gitignore .gitignore |
Removed go.work.sum entry; adjusted placement of cosign.exe entry. |
Tests src/store_translation_paths/main_test.go |
Replaced manual membership loop with slices.Contains import and call. |
Dependency update src/lokalise_upload/go.mod |
Bumped github.com/bodrovis/lokex/v2 from v2.0.0 → v2.0.1. |
Sequence Diagram(s)
sequenceDiagram
participant User as User / Workflow
participant Action as Composite Action
participant Validator as Validation Logic
participant Steps as Subsequent Steps
rect rgba(200,200,255,0.5)
User->>Action: Trigger action (with or without os_platform)
end
rect rgba(200,255,200,0.5)
Action->>Validator: If os_platform set -> validate value
alt valid
Validator-->>Action: PLATFORM value
else invalid
Validator-->>Action: error (unsupported os_platform)
Action-->>User: fail with guidance
end
end
rect rgba(255,200,200,0.5)
Action->>Validator: If os_platform empty -> auto-detect from RUNNER_OS/RUNNER_ARCH
alt supported runner
Validator-->>Action: PLATFORM detected
else unsupported runner
Validator-->>Action: error (unsupported runner)
Action-->>User: fail with guidance
end
end
rect rgba(200,200,255,0.5)
Action-->>Steps: Pass PLATFORM output
Steps->>Steps: Run platform-specific steps
end
Estimated code review effort
🎯 3 (Moderate) | ⏱️ ~25 minutes
🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
| Check name | Status | Explanation | Resolution |
|---|---|---|---|
| Docstring Coverage | Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. | Write docstrings for the functions missing them to satisfy the coverage threshold. |
✅ Passed checks (2 passed)
| Check name | Status | Explanation |
|---|---|---|
| Description Check | ✅ Passed | Check skipped - CodeRabbit’s high-level summary is enabled. |
| Title check | ✅ Passed | The PR title 'Auto detect OS platform' accurately reflects the primary objective of the changeset, which adds platform auto-detection logic to the action.yml file and updates Go versions across the project. |
✏️ Tip: You can configure your own custom pre-merge checks in the settings.
✨ Finishing Touches
🧪 Generate unit tests (beta)
- Create PR with unit tests
- Post copyable unit tests in a comment
- Commit unit tests in branch
auto_detect_platform
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 and usage tips.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@action.yml`:
- Around line 118-150: The auto-detect branch should normalize RUNNER_OS and
RUNNER_ARCH before matching: create lowercased variables (e.g. RUNNER_OS_LC and
RUNNER_ARCH_LC using printf/... | tr '[:upper:]' '[:lower:]'), normalize common
variants (map "macos" -> "mac", "darwin" -> "mac" if needed, and map arch "x64"
-> "amd64", leave "arm64"), then switch on
"${RUNNER_OS_LC}/${RUNNER_ARCH_MAPPED}" instead of raw RUNNER_OS/RUNNER_ARCH and
set PLATFORM accordingly; update the case patterns used in the auto-detect block
and keep validate_platform, OS_PLATFORM and PLATFORM logic unchanged.
ℹ️ Review info
Configuration used: Repository: lokalise/coderabbit/.coderabbit.yaml
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Jira integration is disabled
You can enable these sources in your CodeRabbit configuration.
⛔ Files ignored due to path filters (1)
src/lokalise_upload/go.sumis excluded by!**/*.sum
📒 Files selected for processing (10)
.github/workflows/build-to-bin.yml.github/workflows/ci.yml.github/workflows/codeql.yml.gitignoreREADME.mdaction.ymlsrc/find_all_files/go.modsrc/lokalise_upload/go.modsrc/store_translation_paths/go.modsrc/store_translation_paths/main_test.go
| OS_PLATFORM="$(printf '%s' "${OS_PLATFORM:-}" \ | ||
| | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//' -e 's/[[:space:]]//g' \ | ||
| | tr '[:upper:]' '[:lower:]')" | ||
|
|
||
| validate_platform() { | ||
| case "$1" in | ||
| linux_amd64|linux_arm64|mac_amd64|mac_arm64) return 0 ;; | ||
| *) return 1 ;; | ||
| esac | ||
| } | ||
|
|
||
| if [[ -n "$OS_PLATFORM" ]]; then | ||
| if ! validate_platform "$OS_PLATFORM"; then | ||
| echo "Error: unsupported 'os_platform' input: '$OS_PLATFORM'" | ||
| echo "Supported values: linux_amd64, linux_arm64, mac_amd64, mac_arm64" | ||
| exit 1 | ||
| fi | ||
| echo "Using user-provided platform: $OS_PLATFORM" | ||
| PLATFORM="$OS_PLATFORM" | ||
| else | ||
| echo "Auto-detecting platform from runner: OS=${RUNNER_OS:-} ARCH=${RUNNER_ARCH:-}" | ||
|
|
||
| case "${RUNNER_OS:-}/${RUNNER_ARCH:-}" in | ||
| Linux/X64) PLATFORM="linux_amd64" ;; | ||
| Linux/ARM64) PLATFORM="linux_arm64" ;; | ||
| macOS/X64) PLATFORM="mac_amd64" ;; | ||
| macOS/ARM64) PLATFORM="mac_arm64" ;; | ||
| *) | ||
| echo "Error: unsupported runner platform: ${RUNNER_OS:-}/${RUNNER_ARCH:-}" | ||
| echo "Please set 'os_platform' input explicitly to one of: linux_amd64, linux_arm64, mac_amd64, mac_arm64" | ||
| exit 1 | ||
| ;; | ||
| esac |
There was a problem hiding this comment.
Normalize RUNNER_OS/RUNNER_ARCH before matching.
On some self‑hosted runners (or future GitHub changes), casing can be linux/x64 or macos/arm64, which would currently fall into the “unsupported” branch even though the platform is valid.
🔧 Suggested hardening
- echo "Auto-detecting platform from runner: OS=${RUNNER_OS:-} ARCH=${RUNNER_ARCH:-}"
-
- case "${RUNNER_OS:-}/${RUNNER_ARCH:-}" in
- Linux/X64) PLATFORM="linux_amd64" ;;
- Linux/ARM64) PLATFORM="linux_arm64" ;;
- macOS/X64) PLATFORM="mac_amd64" ;;
- macOS/ARM64) PLATFORM="mac_arm64" ;;
+ runner_os="$(printf '%s' "${RUNNER_OS:-}" | tr '[:upper:]' '[:lower:]')"
+ runner_arch="$(printf '%s' "${RUNNER_ARCH:-}" | tr '[:upper:]' '[:lower:]')"
+ echo "Auto-detecting platform from runner: OS=${runner_os} ARCH=${runner_arch}"
+
+ case "${runner_os}/${runner_arch}" in
+ linux/x64|linux/amd64) PLATFORM="linux_amd64" ;;
+ linux/arm64) PLATFORM="linux_arm64" ;;
+ macos/x64|macos/amd64) PLATFORM="mac_amd64" ;;
+ macos/arm64) PLATFORM="mac_arm64" ;;📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| OS_PLATFORM="$(printf '%s' "${OS_PLATFORM:-}" \ | |
| | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//' -e 's/[[:space:]]//g' \ | |
| | tr '[:upper:]' '[:lower:]')" | |
| validate_platform() { | |
| case "$1" in | |
| linux_amd64|linux_arm64|mac_amd64|mac_arm64) return 0 ;; | |
| *) return 1 ;; | |
| esac | |
| } | |
| if [[ -n "$OS_PLATFORM" ]]; then | |
| if ! validate_platform "$OS_PLATFORM"; then | |
| echo "Error: unsupported 'os_platform' input: '$OS_PLATFORM'" | |
| echo "Supported values: linux_amd64, linux_arm64, mac_amd64, mac_arm64" | |
| exit 1 | |
| fi | |
| echo "Using user-provided platform: $OS_PLATFORM" | |
| PLATFORM="$OS_PLATFORM" | |
| else | |
| echo "Auto-detecting platform from runner: OS=${RUNNER_OS:-} ARCH=${RUNNER_ARCH:-}" | |
| case "${RUNNER_OS:-}/${RUNNER_ARCH:-}" in | |
| Linux/X64) PLATFORM="linux_amd64" ;; | |
| Linux/ARM64) PLATFORM="linux_arm64" ;; | |
| macOS/X64) PLATFORM="mac_amd64" ;; | |
| macOS/ARM64) PLATFORM="mac_arm64" ;; | |
| *) | |
| echo "Error: unsupported runner platform: ${RUNNER_OS:-}/${RUNNER_ARCH:-}" | |
| echo "Please set 'os_platform' input explicitly to one of: linux_amd64, linux_arm64, mac_amd64, mac_arm64" | |
| exit 1 | |
| ;; | |
| esac | |
| OS_PLATFORM="$(printf '%s' "${OS_PLATFORM:-}" \ | |
| | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//' -e 's/[[:space:]]//g' \ | |
| | tr '[:upper:]' '[:lower:]')" | |
| validate_platform() { | |
| case "$1" in | |
| linux_amd64|linux_arm64|mac_amd64|mac_arm64) return 0 ;; | |
| *) return 1 ;; | |
| esac | |
| } | |
| if [[ -n "$OS_PLATFORM" ]]; then | |
| if ! validate_platform "$OS_PLATFORM"; then | |
| echo "Error: unsupported 'os_platform' input: '$OS_PLATFORM'" | |
| echo "Supported values: linux_amd64, linux_arm64, mac_amd64, mac_arm64" | |
| exit 1 | |
| fi | |
| echo "Using user-provided platform: $OS_PLATFORM" | |
| PLATFORM="$OS_PLATFORM" | |
| else | |
| runner_os="$(printf '%s' "${RUNNER_OS:-}" | tr '[:upper:]' '[:lower:]')" | |
| runner_arch="$(printf '%s' "${RUNNER_ARCH:-}" | tr '[:upper:]' '[:lower:]')" | |
| echo "Auto-detecting platform from runner: OS=${runner_os} ARCH=${runner_arch}" | |
| case "${runner_os}/${runner_arch}" in | |
| linux/x64|linux/amd64) PLATFORM="linux_amd64" ;; | |
| linux/arm64) PLATFORM="linux_arm64" ;; | |
| macos/x64|macos/amd64) PLATFORM="mac_amd64" ;; | |
| macos/arm64) PLATFORM="mac_arm64" ;; | |
| *) | |
| echo "Error: unsupported runner platform: ${RUNNER_OS:-}/${RUNNER_ARCH:-}" | |
| echo "Please set 'os_platform' input explicitly to one of: linux_amd64, linux_arm64, mac_amd64, mac_arm64" | |
| exit 1 | |
| ;; | |
| esac |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@action.yml` around lines 118 - 150, The auto-detect branch should normalize
RUNNER_OS and RUNNER_ARCH before matching: create lowercased variables (e.g.
RUNNER_OS_LC and RUNNER_ARCH_LC using printf/... | tr '[:upper:]' '[:lower:]'),
normalize common variants (map "macos" -> "mac", "darwin" -> "mac" if needed,
and map arch "x64" -> "amd64", leave "arm64"), then switch on
"${RUNNER_OS_LC}/${RUNNER_ARCH_MAPPED}" instead of raw RUNNER_OS/RUNNER_ARCH and
set PLATFORM accordingly; update the case patterns used in the auto-detect block
and keep validate_platform, OS_PLATFORM and PLATFORM logic unchanged.
There was a problem hiding this comment.
🧹 Nitpick comments (1)
action.yml (1)
171-171: Nit: double space in expression reference.Lines 171, 302, and 356 all have
${{ steps.detect-platform.outputs.platform }}with two spaces before}}. GitHub Actions ignores the extra whitespace, so there's no functional impact, but it's inconsistent with every other expression in the file.✏️ Suggested cleanup (apply at all three occurrences)
- PLATFORM: "${{ steps.detect-platform.outputs.platform }}" + PLATFORM: "${{ steps.detect-platform.outputs.platform }}"🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@action.yml` at line 171, Update the PLATFORM environment mapping that uses the expression steps.detect-platform.outputs.platform to remove the stray extra space before the closing braces; replace occurrences of "${{ steps.detect-platform.outputs.platform }}" with "${{ steps.detect-platform.outputs.platform }}" (apply the same fix for all three occurrences) so the expression formatting matches the other entries and remains consistent.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@action.yml`:
- Line 171: Update the PLATFORM environment mapping that uses the expression
steps.detect-platform.outputs.platform to remove the stray extra space before
the closing braces; replace occurrences of "${{
steps.detect-platform.outputs.platform }}" with "${{
steps.detect-platform.outputs.platform }}" (apply the same fix for all three
occurrences) so the expression formatting matches the other entries and remains
consistent.
ℹ️ Review info
Configuration used: Repository: lokalise/coderabbit/.coderabbit.yaml
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Jira integration is disabled
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (2)
README.mdaction.yml
🚧 Files skipped from review as they are similar to previous changes (1)
- README.md
Summary by CodeRabbit
New Features
Documentation
Chores
Tests