Skip to content

chore: fix tag-extension and improve debugging#1074

Merged
Crunchyman-ralph merged 1 commit intomainfrom
chore/fix.CI.p2
Aug 2, 2025
Merged

chore: fix tag-extension and improve debugging#1074
Crunchyman-ralph merged 1 commit intomainfrom
chore/fix.CI.p2

Conversation

@Crunchyman-ralph
Copy link
Collaborator

@Crunchyman-ralph Crunchyman-ralph commented Aug 2, 2025

What type of PR is this?

  • 🐛 Bug fix
  • ✨ Feature
  • 🔌 Integration
  • 📝 Docs
  • 🧹 Refactor
  • Other:

Description

Related Issues

How to Test This

# Example commands or steps

Expected result:

Contributor Checklist

  • Created changeset: npm run changeset
  • Tests pass: npm test
  • Format check passes: npm run format-check (or npm run format to fix)
  • Addressed CodeRabbit comments (if any)
  • Linked related issues (if any)
  • Manually tested the changes

Changelog Entry


For Maintainers

  • PR title follows conventional commits
  • Target branch correct
  • Labels added
  • Milestone assigned (if applicable)

Summary by CodeRabbit

  • Bug Fixes
    • Improved reliability when checking for tags on remote repositories by handling and validating repository URLs more robustly.
    • Enhanced error reporting with detailed information if remote checks fail, especially in CI environments.
    • Added retry logic for tag checks in CI environments to increase robustness.

@changeset-bot
Copy link

changeset-bot bot commented Aug 2, 2025

⚠️ No Changeset found

Latest commit: e4028bc

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Aug 2, 2025

Walkthrough

The script responsible for tagging extensions now includes improved logic for extracting, normalizing, and validating the repository URL before executing git ls-remote. Enhanced error handling and retry logic for CI environments have been added, with detailed error reporting and fallback to the origin remote if the initial check fails.

Changes

Cohort / File(s) Change Summary
Tagging Script Robustness Improvements
.github/scripts/tag-extension.mjs
Improved repository URL extraction and normalization, added detailed error handling, and implemented retry logic for CI environments in the tag existence check.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Suggested reviewers

  • eyaltoledano
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch chore/fix.CI.p2

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@eyaltoledano eyaltoledano self-requested a review August 2, 2025 21:10
Copy link
Owner

@eyaltoledano eyaltoledano left a comment

Choose a reason for hiding this comment

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

third time's the charm

@Crunchyman-ralph Crunchyman-ralph merged commit e0d1d03 into main Aug 2, 2025
2 of 4 checks passed
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4a4bca9 and e4028bc.

📒 Files selected for processing (1)
  • .github/scripts/tag-extension.mjs (1 hunks)
🧰 Additional context used
🧠 Learnings (12)
📓 Common learnings
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/git_workflow.mdc:0-0
Timestamp: 2025-07-18T17:10:31.810Z
Learning: Pull Request descriptions must use the provided template, including Task Overview, Subtasks Completed, Implementation Details, Testing, Breaking Changes, and Related Tasks
Learnt from: Crunchyman-ralph
PR: eyaltoledano/claude-task-master#997
File: apps/extension/src/services/task-repository.ts:25-57
Timestamp: 2025-07-31T21:48:00.389Z
Learning: In the eyaltoledano/claude-task-master repository, every task is always part of a tag - there is no concept of untagged tasks. The tag system is mandatory and comprehensive, meaning all tasks exist within a tag context (with 'master' as the default tag if none specified).
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/git_workflow.mdc:0-0
Timestamp: 2025-07-18T17:10:31.810Z
Learning: Pull Request titles must follow the format: Task <ID>: <Task Title>
Learnt from: eyaltoledano
PR: eyaltoledano/claude-task-master#1069
File: .changeset/floppy-news-buy.md:7-38
Timestamp: 2025-08-02T14:54:52.216Z
Learning: For major feature additions like new CLI commands, eyaltoledano prefers detailed changesets with comprehensive descriptions, usage examples, and feature explanations rather than minimal single-line summaries.
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/dev_workflow.mdc:0-0
Timestamp: 2025-07-18T17:10:12.881Z
Learning: For PRD-driven feature development, create a dedicated tag, draft a PRD in `.taskmaster/docs/`, parse it into tasks, and add a high-level reference in the master tag.
Learnt from: Crunchyman-ralph
PR: eyaltoledano/claude-task-master#1069
File: .changeset/fix-tag-complexity-detection.md:0-0
Timestamp: 2025-08-02T15:33:22.648Z
Learning: For changeset files (.changeset/*.md), Crunchyman-ralph prefers to ignore formatting nitpicks about blank lines between frontmatter and descriptions, as he doesn't mind having them and wants to avoid such comments in future reviews.
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/changeset.mdc:0-0
Timestamp: 2025-07-18T17:07:53.100Z
Learning: Every pull request containing new features, bug fixes, breaking changes, performance improvements, significant refactoring, user-facing documentation updates, dependency updates, or impactful build/tooling changes should include a changeset file.
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-31T22:07:14.034Z
Learning: Import Task Master's development workflow commands and guidelines, treat as if import is in the main CLAUDE.md file.
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/glossary.mdc:0-0
Timestamp: 2025-07-18T17:10:53.657Z
Learning: Guidelines for integrating new features into the Task Master CLI with tagged system considerations (new_features.mdc).
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/new_features.mdc:0-0
Timestamp: 2025-07-18T17:12:57.903Z
Learning: Applies to scripts/modules/*.js : Default to current tag when not specified, support explicit tag selection in advanced features, validate tag existence before operations, and provide clear messaging about tag context.
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/utilities.mdc:0-0
Timestamp: 2025-07-18T17:18:17.759Z
Learning: Applies to scripts/modules/utils.js : Use tag resolution functions for all task data access, provide backward compatibility with legacy format, and default to 'master' tag when no tag is specified.
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/tags.mdc:0-0
Timestamp: 2025-07-18T17:13:30.188Z
Learning: Applies to scripts/modules/* : All commands must resolve the tag using the pattern: options.tag || getCurrentTag(projectRoot) || 'master'
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/tags.mdc:0-0
Timestamp: 2025-07-18T17:13:30.188Z
Learning: Applies to scripts/modules/* : Do not hard-code tag resolution (e.g., const tag = options.tag || 'master';); always use getCurrentTag
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/tasks.mdc:0-0
Timestamp: 2025-07-18T17:14:29.399Z
Learning: Applies to scripts/modules/task-manager.js : Use tag resolution functions to maintain backward compatibility, returning legacy format to core functions and not exposing the tagged structure to existing core logic.
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/new_features.mdc:0-0
Timestamp: 2025-07-18T17:12:57.903Z
Learning: Applies to scripts/modules/*.js : Minimize file I/O operations per feature execution, cache tag resolution results when appropriate, use streaming for large task datasets, and avoid loading all tags when only one is needed.
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/tags.mdc:0-0
Timestamp: 2025-07-18T17:13:30.188Z
Learning: Applies to scripts/modules/* : Do not omit the --tag CLI option in commands that operate on tasks
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/tags.mdc:0-0
Timestamp: 2025-07-18T17:13:30.188Z
Learning: Applies to scripts/modules/* : Every command that reads or writes tasks.json must be tag-aware
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/tags.mdc:0-0
Timestamp: 2025-07-18T17:13:30.188Z
Learning: Audit, fix, test, and document each command for tag support as part of the migration strategy
📚 Learning: applies to scripts/modules/*.js : default to current tag when not specified, support explicit tag se...
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/new_features.mdc:0-0
Timestamp: 2025-07-18T17:12:57.903Z
Learning: Applies to scripts/modules/*.js : Default to current tag when not specified, support explicit tag selection in advanced features, validate tag existence before operations, and provide clear messaging about tag context.

Applied to files:

  • .github/scripts/tag-extension.mjs
📚 Learning: applies to scripts/modules/utils.js : use tag resolution functions for all task data access, provide...
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/utilities.mdc:0-0
Timestamp: 2025-07-18T17:18:17.759Z
Learning: Applies to scripts/modules/utils.js : Use tag resolution functions for all task data access, provide backward compatibility with legacy format, and default to 'master' tag when no tag is specified.

Applied to files:

  • .github/scripts/tag-extension.mjs
📚 Learning: applies to scripts/modules/* : do not hard-code tag resolution (e.g., const tag = options.tag || 'ma...
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/tags.mdc:0-0
Timestamp: 2025-07-18T17:13:30.188Z
Learning: Applies to scripts/modules/* : Do not hard-code tag resolution (e.g., const tag = options.tag || 'master';); always use getCurrentTag

Applied to files:

  • .github/scripts/tag-extension.mjs
📚 Learning: applies to scripts/modules/task-manager.js : use tag resolution functions to maintain backward compa...
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/tasks.mdc:0-0
Timestamp: 2025-07-18T17:14:29.399Z
Learning: Applies to scripts/modules/task-manager.js : Use tag resolution functions to maintain backward compatibility, returning legacy format to core functions and not exposing the tagged structure to existing core logic.

Applied to files:

  • .github/scripts/tag-extension.mjs
📚 Learning: applies to scripts/modules/* : all commands must pass { projectroot, tag } as context to core functi...
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/tags.mdc:0-0
Timestamp: 2025-07-18T17:13:30.188Z
Learning: Applies to scripts/modules/* : All commands must pass { projectRoot, tag } as context to core functions

Applied to files:

  • .github/scripts/tag-extension.mjs
📚 Learning: applies to scripts/modules/* : all commands must resolve the tag using the pattern: options.tag || g...
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/tags.mdc:0-0
Timestamp: 2025-07-18T17:13:30.188Z
Learning: Applies to scripts/modules/* : All commands must resolve the tag using the pattern: options.tag || getCurrentTag(projectRoot) || 'master'

Applied to files:

  • .github/scripts/tag-extension.mjs
📚 Learning: applies to scripts/modules/task-manager.js : core functions must receive the legacy format for 100% ...
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/tasks.mdc:0-0
Timestamp: 2025-07-18T17:14:29.399Z
Learning: Applies to scripts/modules/task-manager.js : Core functions must receive the legacy format for 100% backward compatibility, using tag resolution functions to abstract the tagged structure.

Applied to files:

  • .github/scripts/tag-extension.mjs
📚 Learning: applies to scripts/modules/*.js : when implementing core logic for new features, do so in 'scripts/m...
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/new_features.mdc:0-0
Timestamp: 2025-07-18T17:12:57.903Z
Learning: Applies to scripts/modules/*.js : When implementing core logic for new features, do so in 'scripts/modules/' before CLI or MCP interfaces, and design functions to work with both legacy and tagged data formats using tag resolution functions.

Applied to files:

  • .github/scripts/tag-extension.mjs
📚 Learning: applies to scripts/modules/* : every command that reads or writes tasks.json must be tag-aware...
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/tags.mdc:0-0
Timestamp: 2025-07-18T17:13:30.188Z
Learning: Applies to scripts/modules/* : Every command that reads or writes tasks.json must be tag-aware

Applied to files:

  • .github/scripts/tag-extension.mjs
📚 Learning: applies to scripts/modules/**/*.test.js : test core logic independently with both data formats, mock...
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/new_features.mdc:0-0
Timestamp: 2025-07-18T17:12:57.903Z
Learning: Applies to scripts/modules/**/*.test.js : Test core logic independently with both data formats, mock file system operations, test tag resolution behavior, and verify migration compatibility in unit tests.

Applied to files:

  • .github/scripts/tag-extension.mjs
📚 Learning: in the eyaltoledano/claude-task-master repository, the vs code extension uses a 3-file packaging sys...
Learnt from: Crunchyman-ralph
PR: eyaltoledano/claude-task-master#997
File: apps/extension/package.publish.json:2-8
Timestamp: 2025-07-31T20:49:04.638Z
Learning: In the eyaltoledano/claude-task-master repository, the VS Code extension uses a 3-file packaging system where package.json (with name "extension") is for development within the monorepo, while package.publish.json (with name "task-master-hamster") contains the clean manifest for VS Code marketplace publishing. The different names are intentional and serve distinct purposes in the build and publishing workflow.

Applied to files:

  • .github/scripts/tag-extension.mjs
🪛 GitHub Actions: CI
.github/scripts/tag-extension.mjs

[error] 89-105: Biome formatter check failed. Formatting differences detected in lines 89-105. Run 'biome format .' to fix code style issues.

🔇 Additional comments (3)
.github/scripts/tag-extension.mjs (3)

65-74: LGTM! Robust URL extraction and normalization.

The enhanced logic properly handles both object and string repository formats, with appropriate URL normalization for git ls-remote compatibility.


76-81: Good debugging improvements.

The added logging and proper encoding/environment handling enhance the script's debuggability and robustness.


105-105: Improved robustness in tag existence check.

The explicit String() conversion and trim() make the check more defensive against edge cases.

Comment on lines +83 to +103
if (gitResult.status !== 0) {
console.error('Git ls-remote failed:');
console.error('Exit code:', gitResult.status);
console.error('Error:', gitResult.error);
console.error('Stderr:', gitResult.stderr);
console.error('Command:', `git ls-remote ${repoUrl} ${tag}`);

// For CI environments, try using origin instead of the full URL
if (process.env.CI) {
console.log('Retrying with origin remote...');
gitResult = spawnSync('git', ['ls-remote', 'origin', tag], {
encoding: 'utf8'
});

if (gitResult.status !== 0) {
throw new Error(`Failed to check remote for tag ${tag}. Exit code: ${gitResult.status}`);
}
} else {
throw new Error(`Failed to check remote for tag ${tag}. Exit code: ${gitResult.status}`);
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Excellent error handling, but fix formatting issues.

The comprehensive error logging and CI retry logic significantly improve the script's robustness. However, there's a formatting issue that needs to be addressed.

The pipeline indicates formatting issues in this section. Run the following to fix:

#!/bin/bash
# Fix Biome formatting issue
cd .github/scripts && biome format tag-extension.mjs --write
🤖 Prompt for AI Agents
In .github/scripts/tag-extension.mjs around lines 83 to 103, the code has
formatting issues flagged by the pipeline. To fix this, run the biome formatter
on the file by navigating to the .github/scripts directory and executing "biome
format tag-extension.mjs --write" to automatically correct the formatting
inconsistencies.

Crunchyman-ralph added a commit to iamladi/claude-task-master that referenced this pull request Aug 11, 2025
Crunchyman-ralph added a commit to iamladi/claude-task-master that referenced this pull request Aug 11, 2025
stephanschielke pushed a commit to stephanschielke/cursor-task-master that referenced this pull request Aug 22, 2025
stephanschielke pushed a commit to stephanschielke/cursor-task-master that referenced this pull request Aug 22, 2025
sfc-gh-dflippo pushed a commit to sfc-gh-dflippo/task-master-ai that referenced this pull request Dec 4, 2025
@coderabbitai coderabbitai bot mentioned this pull request Feb 13, 2026
16 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants