-
-
Notifications
You must be signed in to change notification settings - Fork 11
Feat/failover labels #91
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
Conversation
Caution Review failedThe pull request is closed. WalkthroughThe recent changes enhance the auto-labeling functionality by introducing the Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant Issue
participant LabelManager
participant ConfigLoader
User->>Issue: Create Issue without specific labels
Issue->>ConfigLoader: Load configuration
ConfigLoader->>LabelManager: Retrieve labels (including failover)
LabelManager-->>ConfigLoader: Return applicable labels
ConfigLoader-->>Issue: Apply labels (including failover labels if needed)
Issue->>User: Issue created with labels
Assessment against linked issues
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
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 as PR comments)
Additionally, you can add CodeRabbit Configuration File (
|
There was a problem hiding this 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 UI
Review profile: CHILL
Files selected for processing (8)
- README.md (2 hunks)
- action.yml (1 hunks)
- src/domain/getConfigFile.ts (3 hunks)
- src/domain/getLabelConfigs.ts (1 hunks)
- src/runner.spec.ts (4 hunks)
- src/runner.ts (2 hunks)
- src/scraper/text.spec.ts (1 hunks)
- src/scraper/text.ts (4 hunks)
Additional comments not posted (18)
action.yml (1)
26-28
: LGTM! The new input parameterfailover-labels
is well-integrated.The addition of the
failover-labels
parameter enhances the flexibility of the workflow by providing a fallback mechanism for labels.src/scraper/text.spec.ts (3)
10-10
: LGTM! The function call simplification improves readability.The removal of the empty array argument for default labels streamlines the function's interface.
18-18
: LGTM! The function call simplification improves readability.The removal of the empty array argument for default labels streamlines the function's interface.
28-28
: LGTM! The function call simplification improves readability.The removal of the empty array argument for default labels streamlines the function's interface.
src/domain/getConfigFile.ts (2)
7-7
: LGTM! The new propertyfailoverLabels
is well-integrated.The addition of the
failoverLabels
property enhances the configuration structure by allowing for a fallback mechanism for labels.
20-20
: LGTM! ThegetConfigFile
function is correctly modified to includefailoverLabels
.The modification ensures that the new configuration option is populated correctly and integrated into the overall configuration output.
Also applies to: 35-35
src/scraper/text.ts (2)
Line range hint
9-22
:
LGTM! Conditional creation oflabelsRegex
is correct.The changes ensure that
labelsRegex
is only created iflabels
is not empty, preventing potential errors whenlabelsRegex
isnull
.
54-54
: LGTM! Simplified return values ingetIssueLabels
.The removal of
defaultLabels
and returning onlyselectedLabels
simplifies the function and aligns with the PR objectives.src/runner.ts (2)
25-26
: LGTM! AddedfailoverLabels
to configuration retrieval.The addition of
failoverLabels
enhances the functionality by providing fallback labels when primary labels are absent.
56-61
: LGTM! Improved label application logic.The changes ensure that issues are labeled more robustly by using
failoverLabels
when no primary labels are found. The logging statements have been refined for clarity.src/domain/getLabelConfigs.ts (1)
52-52
: LGTM! AddedfailoverLabels
toconfigObject
.The inclusion of
failoverLabels
enhances the function's capability to handle more complex label configurations.src/runner.spec.ts (3)
30-30
: LGTM!The dynamic assignment of
getRepoLabels
enhances the flexibility of the test cases.
32-33
: LGTM!The mocks for
addLabels
andgetRepoLabels
are appropriate for isolating therun
function during testing.
49-49
: LGTM!The updated assertion ensures that the correct arguments are passed to
addLabelsSpy
.README.md (4)
69-69
: LGTM!The
include-title
option allows users to include or exclude the title in the labels search.
71-71
: LGTM!The
failover-labels
option specifies labels to be applied when no labels are found in the issue text.
226-236
: LGTM!The
Include Title
section provides clear instructions on how to use theinclude-title
option.
245-265
: LGTM!The
Failover Labels
section provides clear instructions on how to use thefailover-labels
option.
closes #18
document #24