Priorize groups by order #61

Closed
opened 2022-06-18 18:59:31 +00:00 by 6543 · 4 comments
Owner

at the moment a simple map[] is used, we should see the group list as priorized list since you can have lable overlap.

at the moment we could call it "unpredicted" behaviour!!!

https://github.com/go-gitea/gitea/pull/20023#issuecomment-1159518632

at the moment a simple map[] is used, we should see the group list as priorized list since you can have lable overlap. at the moment we could call it "unpredicted" behaviour!!! https://github.com/go-gitea/gitea/pull/20023#issuecomment-1159518632
Owner

I have checked the code, Group is a slice and PR is also a slice which could be sort. I don't know what did you mean a simple map[] is used.

I have checked the code, `Group` is a slice and `PR` is also a slice which could be sort. I don't know what did you mean `a simple map[] is used`.
Author
Owner
https://gitea.com/gitea/changelog/src/branch/master/cmd/generate.go#L24 https://gitea.com/gitea/changelog/src/branch/master/cmd/generate.go#L106-L108 we need am more inteligent function ...
Owner

A map is used, however the issue is not the map, but that the PR labels are only looped until first match.
The original idea was that labels wouldn't be overlapping.

A fix may be as simple as ordering PR labels by weight prior to looping.

A map is used, however the issue is not the map, but that the PR labels are only looped until first match. The original idea was that labels wouldn't be overlapping. A fix may be as simple as ordering PR labels by weight prior to looping.
Author
Owner

i would not weight labels but see the order of group as priority

so if

# Changelog groups and which labeled PRs to add to each group
groups:
  -
    name: FEATURES
    labels:
      - feature
  -
    name: BUGFIXES
    labels:
      - bug

and a pull has both labels, it is in the feature group

i would not weight labels but see the order of group as priority so if ```yml # Changelog groups and which labeled PRs to add to each group groups: - name: FEATURES labels: - feature - name: BUGFIXES labels: - bug ``` and a pull has both labels, it is in the feature group
lunny closed this issue 2022-06-22 01:27:25 +00:00
Sign in to join this conversation.
No Milestone
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: gitea/changelog#61
No description provided.