Add milestones subcomands
#149
Merged
6543
merged 18 commits from 6543/tea:feat_milestones
into master
3 years ago
Loading…
Reference in New Issue
There is no content yet.
Delete Branch '6543/tea:feat_milestones'
Deleting a branch is permanent. It CANNOT be undone. Continue?
close #123
I think it is ready now ?
@ -0,0 +276,4 @@
// since there is no API to resolve it we have to iterate all milestones :/
// https://gitea.com/gitea/go-sdk/issues/383
i := 0
for {
Maybe we need a new API PR at first.
@lunny I tested it - the speed is totaly ok
And I think we should not block this feature - instead migrate to a better solution with go-sdk v0.13 migration
this isssue is on track of 0.13.0 so it should make no problem or do I miss something?
How many milestones on your tested repository?
not that mouch - but since ListRepoMilestone return up to
>APIMaxItem<
say you have 300 MS it would take by default 6 api calls to lookup - and you always have the choice to use the ID insteadbecause of your concerns of the milestone-id lookup function
should we move this feature into the next milestone?
@lunny
upstream pull: https://github.com/go-gitea/gitea/pull/12336
@lunny I created a pull to the sdk: gitea/go-sdk#388
the ms-name-resolve will be removed/optimized if sdk v0.13.0 is out ...
@ -0,0 +268,4 @@
Flags: AllDefaultFlags,
}
func getMileIDbyNameOrID(client *gitea.Client, owner, repo, nameOrID string) (int64, error) {
I'm really not a fan of this function name. What's wrong with just getMilestoneID?
I'll refactor it to getMilestone because List return a full usable milestone ...
getMilestoneID is fine, beside MilestoneDetails only ID is needed ...
@ -0,0 +106,4 @@
if state == gitea.StateAll {
headers = append(headers, "State")
}
headers = append(headers, []string{
Why bother creating the []string{...}... when you can just let the compiler do that for you.
@ -0,0 +127,4 @@
if state == gitea.StateAll {
item = append(item, string(m.State))
}
item = append(item, []string{
simy here.
@zeripath done
7c30579900
into master 3 years agoAdd milestones subcomandto Add milestones subcomands 3 years ago7c30579900
.Step 1:
From your project repository, check out a new branch and test the changes.Step 2:
Merge the changes and update on Gitea.