Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
bob.devtools
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
bob
bob.devtools
Commits
ebab6d60
Commit
ebab6d60
authored
5 years ago
by
Amir MOHAMMADI
Browse files
Options
Downloads
Patches
Plain Diff
Always add bob.devtools to the output of changelog
parent
29b6740f
No related branches found
No related tags found
1 merge request
!145
Improve the release scripts
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
bob/devtools/scripts/changelog.py
+16
-18
16 additions, 18 deletions
bob/devtools/scripts/changelog.py
with
16 additions
and
18 deletions
bob/devtools/scripts/changelog.py
+
16
−
18
View file @
ebab6d60
...
@@ -22,41 +22,39 @@ Examples:
...
@@ -22,41 +22,39 @@ Examples:
1. Generates the changelog for a single package using merge requests:
1. Generates the changelog for a single package using merge requests:
$ bdt gitlab changelog group/package.xyz changelog.md
$ bdt gitlab changelog
-vvv
group/package.xyz changelog.md
2. The same as above, but dumps the changelog to stdout instead of a file:
2. The same as above, but dumps the changelog to stdout instead of a file:
$ bdt gitlab changelog group/package.xyz
$ bdt gitlab changelog
-vvv
group/package.xyz
3. Generates the changelog for a single package looking at commits
3. Generates the changelog for a single package looking at commits
(not merge requests):
(not merge requests):
$ bdt gitlab changelog --mode=commits group/package.xyz changelog.md
$ bdt gitlab changelog
-vvv
--mode=commits group/package.xyz changelog.md
4. Generates the changelog for a single package looking at merge requests starting from a given date of January 1, 2016:
4. Generates the changelog for a single package looking at merge requests starting from a given date of January 1, 2016:
\b
\b
$ bdt gitlab changelog --mode=mrs --since=2016-01-01 group/package.xyz changelog.md
$ bdt gitlab changelog
-vvv
--mode=mrs --since=2016-01-01 group/package.xyz changelog.md
5. Generates a complete list of changelogs for a list of packages (one per line:
5. Generates a complete list of changelogs for a list of packages (one per line
)
:
\b
\b
$ bdt gitlab getpath bob/bob.nightlies order.txt
$ bdt gitlab getpath bob/bob.nightlies order.txt
$ bdt gitlab lasttag bob/bob
$ bdt gitlab lasttag bob/bob
# copy and paste date to next command
# copy and paste date to next command
$ bdt gitlab changelog --since=
"
2018-07-17 10:23:40
"
order.txt changelog.md
$ bdt gitlab changelog
-vvv
--since=
"
2018-07-17 10:23:40
"
order.txt changelog.md
"""
"""
)
)
@click.argument
(
"
target
"
)
@click.argument
(
"
target
"
)
@click.argument
(
@click.argument
(
"
changelog
"
,
"
changelog
"
,
type
=
click
.
Path
(
type
=
click
.
Path
(
exists
=
False
,
dir_okay
=
False
,
file_okay
=
True
,
writable
=
True
),
exists
=
False
,
dir_okay
=
False
,
file_okay
=
True
,
writable
=
True
),
required
=
False
,
required
=
False
,
)
)
@click.option
(
@click.option
(
...
@@ -102,9 +100,9 @@ def changelog(target, changelog, group, mode, since):
...
@@ -102,9 +100,9 @@ def changelog(target, changelog, group, mode, since):
an existing file containing a list of packages that will be iterated on.
an existing file containing a list of packages that will be iterated on.
For each package, we will contact the Gitlab server and create a changelog
For each package, we will contact the Gitlab server and create a changelog
using merge-requests (default), tags or commits since a given date. If a
using merge-requests (default), tags or commits since a given date. If a
starting date is not passed, we
'
ll use the date of the last tagged value or
starting date is not passed, we
'
ll use the date of the last tagged value or
the date of the first commit, if no tags are available in the package.
the date of the first commit, if no tags are available in the package.
"""
"""
gl
=
get_gitlab_instance
()
gl
=
get_gitlab_instance
()
...
@@ -119,15 +117,17 @@ def changelog(target, changelog, group, mode, since):
...
@@ -119,15 +117,17 @@ def changelog(target, changelog, group, mode, since):
if
k
.
strip
()
and
not
k
.
strip
().
startswith
(
"
#
"
)
if
k
.
strip
()
and
not
k
.
strip
().
startswith
(
"
#
"
)
]
]
else
:
else
:
logger
.
info
(
logger
.
info
(
"
Assuming %s is a package name (file does not exist)...
"
,
target
)
"
Assuming %s is a package name (file does not exist)...
"
,
target
)
packages
=
[
target
]
packages
=
[
target
]
# if the user passed a date, convert it
# if the user passed a date, convert it
if
since
:
if
since
:
since
=
parse_date
(
since
)
since
=
parse_date
(
since
)
# Since tagging packages requires bob.devtools to be tagged first. Add that to the
# list as well. Note that bob.devtools can release itself.
packages
.
insert
(
0
,
"
bob/bob.devtools
"
)
# iterates over the packages and dumps required information
# iterates over the packages and dumps required information
for
package
in
packages
:
for
package
in
packages
:
...
@@ -179,7 +179,5 @@ def changelog(target, changelog, group, mode, since):
...
@@ -179,7 +179,5 @@ def changelog(target, changelog, group, mode, since):
changelog_file
=
open
(
changelog
,
"
at
"
)
changelog_file
=
open
(
changelog
,
"
at
"
)
# write_tags(f, use_package, last_release_date)
# write_tags(f, use_package, last_release_date)
write_tags_with_commits
(
write_tags_with_commits
(
changelog_file
,
use_package
,
last_release_date
,
mode
)
changelog_file
,
use_package
,
last_release_date
,
mode
)
changelog_file
.
flush
()
changelog_file
.
flush
()
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment