Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
b7752b8c
Unverified
Commit
b7752b8c
authored
Sep 23, 2019
by
Dominik Prokop
Committed by
GitHub
Sep 23, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update changelog task to generate toolkit changelog too (#19262)
parent
bbf2bd18
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
53 additions
and
31 deletions
+53
-31
packages/grafana-toolkit/CHANGELOG.md
+4
-0
packages/grafana-toolkit/src/cli/index.ts
+1
-0
packages/grafana-toolkit/src/cli/tasks/changelog.ts
+48
-31
No files found.
packages/grafana-toolkit/CHANGELOG.md
View file @
b7752b8c
# 6.4.0 (unreleased)
# 6.4.0-beta1 (2019-09-17)
First release, see
[
Readme
](
https://github.com/grafana/grafana/blob/v6.4.0-beta1/packages/grafana-toolkit/README.md
)
for details.
packages/grafana-toolkit/src/cli/index.ts
View file @
b7752b8c
...
@@ -62,6 +62,7 @@ export const run = (includeInternalScripts = false) => {
...
@@ -62,6 +62,7 @@ export const run = (includeInternalScripts = false) => {
await
execTask
(
changelogTask
)({
await
execTask
(
changelogTask
)({
milestone
:
cmd
.
milestone
,
milestone
:
cmd
.
milestone
,
silent
:
true
,
});
});
});
});
...
...
packages/grafana-toolkit/src/cli/tasks/changelog.ts
View file @
b7752b8c
...
@@ -2,12 +2,53 @@
...
@@ -2,12 +2,53 @@
import
*
as
_
from
'lodash'
;
import
*
as
_
from
'lodash'
;
import
{
Task
,
TaskRunner
}
from
'./task'
;
import
{
Task
,
TaskRunner
}
from
'./task'
;
import
GithubClient
from
'../utils/githubClient'
;
import
GithubClient
from
'../utils/githubClient'
;
import
difference
from
'lodash/difference'
;
import
chalk
from
'chalk'
;
import
{
useSpinner
}
from
'../utils/useSpinner'
;
interface
ChangelogOptions
{
interface
ChangelogOptions
{
milestone
:
string
;
milestone
:
string
;
}
}
const
changelogTaskRunner
:
TaskRunner
<
ChangelogOptions
>
=
async
({
milestone
})
=>
{
const
filterBugs
=
(
item
:
any
)
=>
{
if
(
item
.
title
.
match
(
/fix|fixes/i
))
{
return
true
;
}
if
(
item
.
labels
.
find
((
label
:
any
)
=>
label
.
name
===
'type/bug'
))
{
return
true
;
}
return
false
;
};
const
getPackageChangelog
=
(
packageName
:
string
,
issues
:
any
[])
=>
{
if
(
issues
.
length
===
0
)
{
return
''
;
}
let
markdown
=
chalk
.
bold
.
yellow
(
`\n\n/***
${
packageName
}
changelog ***/\n\n`
);
const
bugs
=
_
.
sortBy
(
issues
.
filter
(
filterBugs
),
'title'
);
const
notBugs
=
_
.
sortBy
(
difference
(
issues
,
bugs
),
'title'
);
if
(
notBugs
.
length
>
0
)
{
markdown
+=
'### Features / Enhancements
\
n'
;
for
(
const
item
of
notBugs
)
{
markdown
+=
getMarkdownLineForIssue
(
item
);
}
}
if
(
bugs
.
length
>
0
)
{
markdown
+=
'
\
n### Bug Fixes
\
n'
;
for
(
const
item
of
bugs
)
{
markdown
+=
getMarkdownLineForIssue
(
item
);
}
}
return
markdown
;
};
const
changelogTaskRunner
:
TaskRunner
<
ChangelogOptions
>
=
useSpinner
<
ChangelogOptions
>
(
'Generating changelog'
,
async
({
milestone
})
=>
{
const
githubClient
=
new
GithubClient
();
const
githubClient
=
new
GithubClient
();
const
client
=
githubClient
.
client
;
const
client
=
githubClient
.
client
;
...
@@ -26,42 +67,18 @@ const changelogTaskRunner: TaskRunner<ChangelogOptions> = async ({ milestone })
...
@@ -26,42 +67,18 @@ const changelogTaskRunner: TaskRunner<ChangelogOptions> = async ({ milestone })
});
});
const
issues
=
res
.
data
;
const
issues
=
res
.
data
;
const
toolkitIssues
=
issues
.
filter
((
item
:
any
)
=>
const
bugs
=
_
.
sortBy
(
item
.
labels
.
find
((
label
:
any
)
=>
label
.
name
===
'area/grafana/toolkit'
)
issues
.
filter
((
item
:
any
)
=>
{
if
(
item
.
title
.
match
(
/fix|fixes/i
))
{
return
true
;
}
if
(
item
.
labels
.
find
((
label
:
any
)
=>
label
.
name
===
'type/bug'
))
{
return
true
;
}
return
false
;
}),
'title'
);
);
const
notBugs
=
_
.
sortBy
(
issues
.
filter
((
item
:
any
)
=>
!
bugs
.
find
((
bug
:
any
)
=>
bug
===
item
)),
'title'
);
let
markdown
=
''
;
let
markdown
=
''
;
if
(
notBugs
.
length
>
0
)
{
markdown
+=
getPackageChangelog
(
'Grafana'
,
issues
);
markdown
=
'### Features / Enhancements
\
n'
;
markdown
+=
getPackageChangelog
(
'grafana-toolkit'
,
toolkitIssues
);
}
for
(
const
item
of
notBugs
)
{
markdown
+=
getMarkdownLineForIssue
(
item
);
}
if
(
bugs
.
length
>
0
)
{
markdown
+=
'
\
n### Bug Fixes
\
n'
;
}
for
(
const
item
of
bugs
)
{
markdown
+=
getMarkdownLineForIssue
(
item
);
}
console
.
log
(
markdown
);
console
.
log
(
markdown
);
};
}
);
function
getMarkdownLineForIssue
(
item
:
any
)
{
function
getMarkdownLineForIssue
(
item
:
any
)
{
const
githubGrafanaUrl
=
'https://github.com/grafana/grafana'
;
const
githubGrafanaUrl
=
'https://github.com/grafana/grafana'
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment