Skip to content
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

Adjust make-changelog to work with projects hosted on pagure #28

Merged
merged 11 commits into from Oct 5, 2015

Conversation

pypingou
Copy link
Contributor

No description provided.

…ctly

Currently make-changelog could not retrieve the pull-requests from pagure
since there are most often no merge commit.
To circumvent this situation, we get the date of the first commit in the
series and get all the pull-request that have been merged since then.
As the updated_on field might be missing, we drop back to date_created
in these cases.
This also gives the opportunity to adjust the script more broadly for
github vs pagure.

print
print start
print "-" * len(start)

if pagure:
pulls.extend(get_pull_request_pagure(project, commits[0]))
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks odd. Why commits[0]?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I want the date of the first commit after the last tag, so we get only the pull-request merged after that commit

return title, author, link


def get_pull_request_pagure(project, commit):
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if this returns more than one pull request, it needs to be called get_pull_requests_pagure. Plural to indicate that it returns a collection.

commits = []
for line in output:
line = line.split(None, 4)
commits.append([line[0], ' '.join(line[1:4]), line[4]])
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To make this more readable, could you add an extra line? Something like this:

line = line.split(None, 4)
foo, bar, baz = line[0], ' '.join(line[1:4]), line[4]
commits.append([foo, bar, baz])

Otherwise the reader is left guessing about what those three things are.

@ralphbean
Copy link
Owner

Nice! 👍

ralphbean added a commit that referenced this pull request Oct 5, 2015
Adjust make-changelog to work with projects hosted on pagure
@ralphbean ralphbean merged commit 5e75a45 into ralphbean:develop Oct 5, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants