Skip to content

Conversation

danhellem
Copy link
Contributor

@danhellem danhellem commented Jun 21, 2025

This pull request enhances error handling and testing for the configureCoreTools and configureWorkTools functions. It introduces robust error management for API calls, ensures proper handling of null or empty results, and adds comprehensive test cases to validate these scenarios.

Error Handling Enhancements:

  • Core Tools (src/tools/core.ts):

    • Added try-catch blocks to handle errors during API calls in getTeams and getProjects methods. Errors are now returned with descriptive messages, and null results are handled gracefully. [1] [2] [3] [4]
  • Work Tools (src/tools/work.ts):

    • Introduced try-catch blocks for API calls in getTeamIterations, createOrUpdateClassificationNode, and postTeamIteration. Added checks for null or empty API results and provided meaningful error messages. [1] [2] [3] [4] [5]

Test Coverage Improvements:

  • Core Tools Tests (test/src/tools/core.test.ts):

    • Added test cases to verify error handling for getProjects and getTeams methods. Tests ensure proper behavior when API calls fail or return null results. [1] [2]
  • Work Tools Tests (test/src/tools/work.test.ts):

    • Added test cases for getTeamIterations, createOrUpdateClassificationNode, and postTeamIteration to validate error handling and null result scenarios. [1] [2] [3]

GitHub issue number #57

Associated Risks

No risks

PR Checklist

  • I have read the contribution guidelines
  • I have read the code of conduct guidelines
  • Title of the pull request is clear and informative.
  • 👌 Code hygiene
  • 🔭 Telemetry added, updated, or N/A
  • 📄 Documentation added, updated, or N/A
  • 🛡️ Automated tests added, or N/A

🧪 How did you test it?

Updated tests and re-ran before commit. Checked tools manually.

Copy link

github-actions bot commented Jun 21, 2025

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

@danhellem danhellem added the Needs Review 👓 needs review by the product team label Jun 21, 2025
@danhellem danhellem self-assigned this Jun 21, 2025
Copy link
Contributor

@polatengin polatengin left a comment

Choose a reason for hiding this comment

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

nit-bit suggestion that we can implement later in follow-up PRs;

  • validate inputs (projectId, stateFilter, continuationToken, date format, etc.)

@danhellem danhellem merged commit 04e9d82 into main Jun 23, 2025
11 checks passed
@danhellem danhellem deleted the users/danhellem/task-57 branch June 23, 2025 15:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Needs Review 👓 needs review by the product team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants