Skip to content

fix: read release error_logs from data.error_logs in apps +release-get#1436

Merged
raistlin042 merged 1 commit into
mainfrom
fix/apps-release-get-error-logs
Jun 12, 2026
Merged

fix: read release error_logs from data.error_logs in apps +release-get#1436
raistlin042 merged 1 commit into
mainfrom
fix/apps-release-get-error-logs

Conversation

@raistlin042

@raistlin042 raistlin042 commented Jun 12, 2026

Copy link
Copy Markdown
Collaborator

Summary

apps +release-get read the release error logs from data.release.error_logs, but per the interface doc (app.release/get.yml) the response places release and error_logs as two sibling fields under data. As a result the default JSON output dropped data.error_logs entirely, and the pretty failed table was always empty.

Changes

  • shortcuts/apps/apps_release_get.go: after unwrapping data.release into the flattened output object, graft the sibling data.error_logs onto it so both JSON and pretty output surface the real error logs. The flattened-output contract for the release fields is unchanged.
  • shortcuts/apps/apps_release_get_test.go: correct the failed-release mocks to place error_logs as a sibling of release (matching the real API), and add JSON-passthrough and no-key-when-absent assertions.

Test Plan

  • make unit-test passed (go test ./shortcuts/apps/ -run TestAppsReleaseGet → 13/13)
  • validate passed (build + vet + unit + integration)
  • skipped: sandbox E2E / skillave — lite mode; command surface unchanged and no existing E2E covers this path
  • acceptance-reviewer passed (2/2 scenarios: help, missing-flag, dry-run)
  • manual verification: apps +release-get --help and apps +release-get --app-id <id> --release-id <id> --dry-run — flag validation and identity/error handling confirmed; failed-release error_logs behavior covered by unit tests (a failed release cannot be constructed against a live backend)

Related Issues

N/A

Summary by CodeRabbit

  • Bug Fixes
    • Error logs from failed releases are now included in CLI output when provided by the API.
    • JSON output now shows error logs alongside flattened release fields (e.g., release ID and status).
    • When the API omits error logs, the CLI no longer includes an empty error_logs field in JSON output.

@raistlin042 raistlin042 added bug Something isn't working size/M Single-domain feat or fix with limited business impact labels Jun 12, 2026
@coderabbitai

coderabbitai Bot commented Jun 12, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 19de6fe2-1cdf-41ff-a3c5-c572b9b6deca

📥 Commits

Reviewing files that changed from the base of the PR and between f0fdcc6 and 8d42d08.

📒 Files selected for processing (2)
  • shortcuts/apps/apps_release_get.go
  • shortcuts/apps/apps_release_get_test.go
🚧 Files skipped from review as they are similar to previous changes (2)
  • shortcuts/apps/apps_release_get.go
  • shortcuts/apps/apps_release_get_test.go

📝 Walkthrough

Walkthrough

Adds passthrough of a top-level error_logs field from the API response into the flattened output for the +release-get command; tests were added/refactored to verify JSON output contains error_logs when present and omits it when absent.

Changes

Error logs field passthrough in release-get output

Layer / File(s) Summary
Error logs field merging in command output
shortcuts/apps/apps_release_get.go
Command handler checks for error_logs in the API response and copies it into the flattened out object so downstream formatting logic can access it.
Error logs passthrough and absence validation tests
shortcuts/apps/apps_release_get_test.go
Refactored pretty-output test mock data for clarity. Added JSON tests verifying error_logs is present in output when the API provides it and omitted when the API response lacks the key.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Suggested reviewers

  • liangshuo-1

Poem

I’m a rabbit sifting through the logs,
Hopping past releases, tiny hops and jogs.
I found the errors, laid them out neat,
Flattened and ready — a tidy treat!
🐇✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning 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 (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main fix: reading release error_logs from the correct location (data.error_logs as a sibling field) in the apps +release-get command.
Description check ✅ Passed The description follows the template with complete Summary, Changes, Test Plan (with detailed verification steps), and Related Issues sections. All required elements are present and adequately detailed.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/apps-release-get-error-logs

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov

codecov Bot commented Jun 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 72.89%. Comparing base (2a7e9c7) to head (8d42d08).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1436      +/-   ##
==========================================
+ Coverage   72.83%   72.89%   +0.06%     
==========================================
  Files         732      733       +1     
  Lines       69140    69207      +67     
==========================================
+ Hits        50356    50447      +91     
+ Misses      15003    14977      -26     
- Partials     3781     3783       +2     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions

github-actions Bot commented Jun 12, 2026

Copy link
Copy Markdown

🚀 PR Preview Install Guide

🧰 CLI update

npm i -g https://pkg.pr.new/larksuite/cli/@larksuite/cli@8d42d0818fadda29da7c88cf15aabc7eaae6aa5e

🧩 Skill update

npx skills add larksuite/cli#fix/apps-release-get-error-logs -y -g

@raistlin042
raistlin042 force-pushed the fix/apps-release-get-error-logs branch from f0fdcc6 to 8d42d08 Compare June 12, 2026 08:28
@raistlin042
raistlin042 merged commit 1cd7a88 into main Jun 12, 2026
44 of 50 checks passed
@raistlin042
raistlin042 deleted the fix/apps-release-get-error-logs branch June 12, 2026 08:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working size/M Single-domain feat or fix with limited business impact

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants