-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Keep track of the checks changed at every Datadog Agent release #2277
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
Failed on flake8? Also - and this is a minor thing - but I think we can drop the trailing period following the version numbers. |
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.
Very nice! this new format is simply, effective, and easily searchable!
I just have a couple of feedback about the wording to make it more obvious for the user when scrolling fast in the changelog.
# go through all the agent releases | ||
for agent, changes in changes_per_agent.iteritems(): | ||
url = agent_changelog_url.format(agent) | ||
changelog.write('## Datadog Agent [{}]({})\n\n'.format(agent, url)) |
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.
Should we say ## Datadog Agent version %%
?
Also, do we want to also specify the Agent version release date?
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.
Showing the date is tricky because it would be the date the tag was added on integrations-core
, that might be slightly different from the real one
changelog.write('* There were no check updates for this version of the Agent.\n\n') | ||
else: | ||
for name, ver in changes.iteritems(): | ||
breaking_notice = "This is a breaking change." if ver[1] else "" |
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.
We should make the breaking notice more obvious I think. What do you think of BREAKING CHANGE
?
Codecov Report
@@ Coverage Diff @@
## master #2277 +/- ##
===========================================
- Coverage 85.66% 74.84% -10.82%
===========================================
Files 188 17 -171
Lines 13254 493 -12761
Branches 1435 57 -1378
===========================================
- Hits 11354 369 -10985
+ Misses 1493 105 -1388
+ Partials 407 19 -388 |
if len(toks) != 2 or not toks[0] or not toks[1]: | ||
# if we get here, the requirements file is garbled but let's stay | ||
# resilient | ||
continue |
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.
Do we want to print a message as well just in case ?
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.
This is only necessary because we checked in and tagged a file with a git conflict at some point 🙈
Now that the changes to the reqfile are automated, this shouldn't happen again and if I log something we'll get the warning from that one tag forever
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.
Awesome tool!
@click.pass_context | ||
def agent_changelog(ctx, since, to, output, force): | ||
""" | ||
FIXME |
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.
you know what i think about FIXME and TODO in code 😝
|
||
|
||
def git_tag_list(pattern=None): | ||
with chdir(get_root()): |
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.
Could you add some descriptions here as well
def parse_agent_req_file(contents): | ||
""" | ||
Returns a dictionary mapping {check_name --> pinned_version} from the | ||
given file contents. We can assume lines are in the form: |
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.
Shouldn't we have a small validation just in case the assumption fails for whatever reasons
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.
That's pip
syntax, it's a safe assumption to make for now since the requirements file is auto generated.
# reverse so we have descendent order | ||
agent_tags = agent_tags[::-1] | ||
|
||
# store the changes in a mapping {agent_version --> {check_name --> current_version}} |
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.
Thanks for the comment 👍
changelog = StringIO() | ||
|
||
# prepare the links | ||
agent_changelog_url = 'https://github.com/DataDog/datadog-agent/blob/master/CHANGELOG.rst#{}' |
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.
I am guessing we don't support agent 5?
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.
Correct, we only support Agent 6.3.0+
changelog.write('## Datadog Agent version [{}]({})\n\n'.format(agent, url)) | ||
|
||
if not changes: | ||
changelog.write('* There were no check updates for this version of the Agent.\n\n') |
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.
should we call our stuff check
, or integration
or maybe even integration check
?
for name, ver in changes.iteritems(): | ||
breaking_notice = " **BREAKING CHANGE** " if ver[1] else "" | ||
changelog_url = check_changelog_url.format(name) | ||
changelog.write('* {} [{}]({}){}\n'.format(name, ver[0], changelog_url, breaking_notice)) |
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.
I understand it may be a little bit more complex to implement. However do we want to write the integration name or the integration folder name. For example MySQL
instead mysql
?
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.
Folder
changelog.write('\n') | ||
|
||
# save the changelog on disk if --output was passed | ||
if output: |
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.
Could you add a dry run param that just output to stdout
?
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.
It's what it does if you don't pass -o
(see the else
branch)
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.
Looks pretty good to me now. Thanks 🥇
What does this PR do?
Adds the
release agent_changelog
command toddev
to provide a list of the changes for every Agent release in the form of a changelog file.Motivation
The Agent changelog points to an invalid list of changed checks, from now on it can point directly the
AGENT_CHANGELOG.md
file from the root of this repo.Review checklist
no-changelog
label attachedAdditional Notes
Generating the changelog is still a manual procedure!