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

Create new milestones automatically #37

Merged
merged 17 commits into from
Aug 31, 2020

Conversation

geerteltink
Copy link
Member

Q A
New Feature yes

Description

Create next milestones after a release is prepared.

Closes #26

@geerteltink geerteltink marked this pull request as draft August 10, 2020 18:12
src/Application/Command/CreateMilestones.php Outdated Show resolved Hide resolved
src/Github/Api/V3/CreateMilestoneThroughApiCall.php Outdated Show resolved Hide resolved
@Ocramius Ocramius modified the milestones: 1.2.0, 1.3.0 Aug 12, 2020
@weierophinney weierophinney modified the milestones: 1.3.0, 1.4.0 Aug 26, 2020
Signed-off-by: Geert Eltink <dev@elt.ink>
@weierophinney weierophinney changed the base branch from 1.2.x to 1.4.x August 26, 2020 19:56
Signed-off-by: Geert Eltink <dev@elt.ink>
Signed-off-by: Geert Eltink <dev@elt.ink>
Signed-off-by: Geert Eltink <dev@elt.ink>
Signed-off-by: Geert Eltink <dev@elt.ink>
Signed-off-by: Geert Eltink <dev@elt.ink>
Signed-off-by: Geert Eltink <dev@elt.ink>
Signed-off-by: Geert Eltink <dev@elt.ink>
Signed-off-by: Geert Eltink <dev@elt.ink>
@geerteltink geerteltink marked this pull request as ready for review August 30, 2020 19:32
Signed-off-by: Geert Eltink <dev@elt.ink>
Signed-off-by: Geert Eltink <dev@elt.ink>
@geerteltink
Copy link
Member Author

@Ocramius ready for final review. The test repo I used is here: https://github.com/xtreamwayz/refactored-stroopwafel/milestones. All milestones there are automatically created.

Copy link
Member

@Ocramius Ocramius left a comment

Choose a reason for hiding this comment

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

Minor changes needed. Overall OK with adding this as a new step (although perhaps earlier in the release workflow?)

We kinda need to simplify the setup for end users though, so that they don't need to change their configuration all the time (new ticket, perhaps?)

.github/workflows/automatic-release.yml Show resolved Hide resolved
.github/workflows/automatic-release.yml Outdated Show resolved Hide resolved
Makefile Show resolved Hide resolved
examples/.github/workflows/release-on-milestone-closed.yml Outdated Show resolved Hide resolved
src/Application/Command/CreateMilestones.php Outdated Show resolved Hide resolved
src/Application/Command/CreateMilestones.php Outdated Show resolved Hide resolved
src/Application/Command/CreateMilestones.php Outdated Show resolved Hide resolved
src/Github/Api/V3/CreateMilestone.php Outdated Show resolved Hide resolved
.github/workflows/automatic-release.yml Show resolved Hide resolved
.github/workflows/automatic-release.yml Outdated Show resolved Hide resolved
src/Application/Command/CreateMilestones.php Outdated Show resolved Hide resolved
src/Application/Command/CreateMilestones.php Outdated Show resolved Hide resolved
Comment on lines +62 to +64
->withAddedHeader('Content-Type', 'application/json')
->withAddedHeader('User-Agent', 'Ocramius\'s minimal API V3 client')
->withAddedHeader('Authorization', 'token ' . $this->apiToken);
Copy link
Member

Choose a reason for hiding this comment

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

Unrelated to this patch, but perhaps we should have a specialized PSR-17 request factory that adds these headers to the request generated by the factory? Thoughts, @Ocramius ?

Copy link
Member

Choose a reason for hiding this comment

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

@weierophinney I don't think this is the responsibility of the factory, but rather of a Github API client: the fact that a token is added, and that a user-agent is added, is specific to Github's requirements, and we can decorate the request there if needed.

I would keep it as-is unless we keep adding more and more Github API interactions.

test/unit/Git/Value/SemVerVersionTest.php Show resolved Hide resolved
test/unit/Git/Value/SemVerVersionTest.php Outdated Show resolved Hide resolved
test/unit/Github/Api/V3/CreateMilestoneTest.php Outdated Show resolved Hide resolved
test/unit/Github/Api/V3/CreateMilestoneTest.php Outdated Show resolved Hide resolved
test/unit/Github/Api/V3/CreateMilestoneTest.php Outdated Show resolved Hide resolved
Signed-off-by: Geert Eltink <dev@elt.ink>
Signed-off-by: Geert Eltink <dev@elt.ink>
Signed-off-by: Geert Eltink <dev@elt.ink>
Signed-off-by: Geert Eltink <dev@elt.ink>
Signed-off-by: Geert Eltink <dev@elt.ink>
Copy link
Member

@Ocramius Ocramius left a comment

Choose a reason for hiding this comment

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

LGTM 🚢

@Ocramius Ocramius changed the title Create new milestones Create new milestones automatically Aug 31, 2020
@geerteltink
Copy link
Member Author

Running some final tests now.

@Ocramius
Copy link
Member

@geerteltink ping me and I'll get 1.4.0 through tonight, if all worked :-)

Copy link
Member

@weierophinney weierophinney left a comment

Choose a reason for hiding this comment

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

Minor tweaks only, but looks good!

test/unit/Github/Api/V3/CreateMilestoneTest.php Outdated Show resolved Hide resolved
test/unit/Github/Api/V3/CreateMilestoneTest.php Outdated Show resolved Hide resolved
test/unit/Github/Api/V3/CreatePullRequestTest.php Outdated Show resolved Hide resolved
test/unit/Github/Api/V3/CreateReleaseTest.php Outdated Show resolved Hide resolved
Signed-off-by: Geert Eltink <dev@elt.ink>
@geerteltink
Copy link
Member Author

@Ocramius 🚢

Copy link
Member

@weierophinney weierophinney left a comment

Choose a reason for hiding this comment

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

Reads well, I can understand what is happening! Nice work, @geerteltink !

@Ocramius Ocramius merged commit c95ea93 into laminas:1.4.x Aug 31, 2020
@Ocramius Ocramius self-assigned this Aug 31, 2020
@geerteltink geerteltink deleted the feat/milestones branch August 31, 2020 20:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create next milestones after a release is prepared
3 participants