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

[FEATURE] - Add bump profiles #104

Closed
oknozor opened this issue Sep 12, 2021 · 0 comments · Fixed by #110
Closed

[FEATURE] - Add bump profiles #104

oknozor opened this issue Sep 12, 2021 · 0 comments · Fixed by #110
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@oknozor
Copy link
Collaborator

oknozor commented Sep 12, 2021

Is your feature request related to a problem? Please describe.
cog bump should be able to execute alternate hooks for a named profile.
For example when using the oneflow git branching model performing a release with cog bump works perfectly but if we need to release a hotfix on the current release branch, we are forced to to this manually.

Describe the solution you'd like
cog.toml should support profile this way :

# The default profile (what we have now)
pre_bump_hooks = [
    "cargo bump {{version}}",
]

post_bump_hooks = [
    "git push",
    "git push origin {{version}}",
    "cargo package",
    "cargo publish"
]

[profiles.hotfix]
pre_bump_hooks = [
    # The target branch containing some hotfix commit
    "git checkout release/{{latest_version}}",
    "cargo bump {{version}}"
]

post_bump_hooks = [
    "git push",
    "git push origin {{version}}",
    "git checkout main",
    "git merge --no-ff release/{{latest_version}}",
    "cargo package",
    "cargo publish"
]

[profiles.some_other_usecase]
# And so on

Additional context
This is straight forward to implement, we just need to add the {{previous_version}} or {{latest_version}}, available in the version DSL.

@oknozor oknozor added enhancement New feature or request good first issue Good for newcomers Hacktoberfest labels Sep 12, 2021
@oknozor oknozor self-assigned this Sep 12, 2021
@oknozor oknozor added this to To do in next release Sep 12, 2021
@oknozor oknozor pinned this issue Sep 13, 2021
oknozor added a commit that referenced this issue Sep 15, 2021
This replace the previous implementation wich allowed
to run cog bump with an alternate config.
Now custom profile can be defined to perform different hooks
on bump. This allow to use several git branching models/workflows.

closes: #104
@oknozor oknozor mentioned this issue Sep 15, 2021
@oknozor oknozor moved this from To do to In progress in next release Sep 15, 2021
@oknozor oknozor moved this from In progress to Done in next release Sep 18, 2021
oknozor added a commit that referenced this issue Sep 19, 2021
This replace the previous implementation wich allowed
to run cog bump with an alternate config.
Now custom profile can be defined to perform different hooks
on bump. This allow to use several git branching models/workflows.

closes: #104
oknozor added a commit that referenced this issue Oct 21, 2021
This replace the previous implementation wich allowed
to run cog bump with an alternate config.
Now custom profile can be defined to perform different hooks
on bump. This allow to use several git branching models/workflows.

closes: #104
oknozor added a commit that referenced this issue Oct 21, 2021
This replace the previous implementation wich allowed
to run cog bump with an alternate config.
Now custom profile can be defined to perform different hooks
on bump. This allow to use several git branching models/workflows.

closes: #104
oknozor added a commit that referenced this issue Oct 28, 2021
This replace the previous implementation wich allowed
to run cog bump with an alternate config.
Now custom profile can be defined to perform different hooks
on bump. This allow to use several git branching models/workflows.

closes: #104
oknozor added a commit that referenced this issue Nov 6, 2021
This replace the previous implementation wich allowed
to run cog bump with an alternate config.
Now custom profile can be defined to perform different hooks
on bump. This allow to use several git branching models/workflows.

closes: #104
oknozor added a commit that referenced this issue Nov 25, 2021
This replace the previous implementation wich allowed
to run cog bump with an alternate config.
Now custom profile can be defined to perform different hooks
on bump. This allow to use several git branching models/workflows.

closes: #104
oknozor added a commit that referenced this issue Nov 30, 2021
This replace the previous implementation wich allowed
to run cog bump with an alternate config.
Now custom profile can be defined to perform different hooks
on bump. This allow to use several git branching models/workflows.

closes: #104
@oknozor oknozor unpinned this issue Dec 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

1 participant