-
-
Notifications
You must be signed in to change notification settings - Fork 8
feat: improve Danger testing and flavor recognition #105
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Implement inline changelog suggestions instead of generic instructions - Add unified flavor configuration with grouped labels - Extract testable functions into dangerfile-utils.js module - Add comprehensive test suite with 21 test cases - Integrate JavaScript testing into CI workflow Resolves #45 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Contributor
|
…in permissions Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
The dangerfile now requires the utils module, so both files need to be downloaded. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Merge all internal change flavors (docs, style, refactor, test, build, ci, chore, deps) into one configuration entry since they all have the same behavior (skip changelog). This reduces the config from 7 separate entries to 1, making it more maintainable. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
…ents Remove inline suggestions functionality to focus this PR on: - Improved flavor recognition and configuration - Testing infrastructure additions - Consolidating skip-changelog flavors The inline suggestions feature will be implemented in a separate PR. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Based on analysis of 60 recent PRs from top Sentry repositories: **Key findings:** - 'ref' is very common (14 occurrences) but missing from our config - 'tests' is used (5 occurrences) and should skip changelog - 'meta' is used for repository maintenance - 'Bug Fixes' is more standard than 'Fixes' for changelog sections **Changes made:** - Add 'ref' flavor mapping to 'Changes' section - Add 'meta' and 'tests' to skip-changelog group - Change 'Fixes' to 'Bug Fixes' (aligns with sentry-javascript) - Update tests and documentation This makes our configuration reflect actual usage patterns in Sentry repositories. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Add comprehensive testing infrastructure with 23 test cases - Fix scope handling for conventional commits (feat(core): -> feat) - Properly classify ref commits as internal changes - Add modular architecture with testable functions - Include CI integration for JavaScript testing 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Contributor
Author
|
@sentry review |
- Remove findChangelogInsertionPoint function (unrelated to flavor recognition) - Add type validation to extractPRFlavor to prevent runtime errors - Add comprehensive tests for input validation - Reduce test count from 23 to 18 focused tests 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Replace regex `/\([^)]*\)/` with indexOf/substring approach - Prevents potential ReDoS attacks with nested parentheses - Improves performance and readability - Add comprehensive edge case tests for malformed scope inputs 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Improves the Danger workflow with comprehensive testing infrastructure, enhanced flavor recognition with proper conventional commit scope handling, and security improvements for better maintainability and reliability.
Key Improvements
feat(core):,fix(browser):)Testing Infrastructure
Enhanced Flavor Support
Now properly handles conventional commit format with scopes and validates inputs:
Conventional Commits with Scopes:
feat(core): add new feature→ "Features" section ✅fix(browser): resolve issue→ "Fixes" section ✅chore(deps): update packages→ skip changelog ✅ref(core): internal refactoring→ skip changelog ✅Input Validation:
extractPRFlavor(null, 123)→ returns""safely (no crash) ✅extractPRFlavor({}, [])→ returns""safely (no crash) ✅Supported Flavors:
feat,feature→ "Features" section, triggers docs reminderfix,bug,bugfix→ "Fixes" sectionsec,security→ "Security" sectionperf,performance→ "Performance" sectiondocs,style,ref,refactor,test,build,ci,chore,deps→ skip changelogConfiguration Improvements
["feat", "feature"]share the same configurationrefHandling: Based on analysis of 228refcommits across Sentry repos, treating as internal changesfindChangelogInsertionPointfunctionBefore vs After
Before:
After:
Test Plan
refcommits correctly classified as internalSecurity Verification
🤖 Generated with Claude Code