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

Add support for configuring default squash and merge commit titles and messages #137

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

soerenmartius
Copy link
Member

No description provided.

@soerenmartius soerenmartius force-pushed the soerenmartius/commit-titles branch 5 times, most recently from 023855a to 3426b72 Compare October 25, 2022 20:59
@soerenmartius soerenmartius marked this pull request as ready for review October 25, 2022 20:59
@soerenmartius soerenmartius requested review from mariux and a team as code owners October 25, 2022 20:59
Copy link
Member

@mariux mariux left a comment

Choose a reason for hiding this comment

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

lgtm

mariux
mariux previously requested changes Oct 25, 2022
Copy link
Member

@mariux mariux left a comment

Choose a reason for hiding this comment

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

  • please fix tests
  • please fix commit messages

@mariux mariux marked this pull request as draft October 25, 2022 22:43
@soerenmartius soerenmartius force-pushed the soerenmartius/commit-titles branch 3 times, most recently from 4300586 to 3ac0c9f Compare October 26, 2022 02:53
@soerenmartius soerenmartius changed the title Add support for configuring defailt squash and merge commit titles and messages Add support for configuring default squash and merge commit titles and messages Oct 26, 2022
@soerenmartius soerenmartius force-pushed the soerenmartius/commit-titles branch 6 times, most recently from a37c872 to 8104872 Compare October 26, 2022 14:00
@soerenmartius soerenmartius marked this pull request as ready for review October 26, 2022 15:57
@soerenmartius soerenmartius requested review from mariux and a team October 26, 2022 16:20
waxb
waxb previously approved these changes Nov 1, 2022
Copy link

@waxb waxb left a comment

Choose a reason for hiding this comment

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

lgtm

@soerenmartius
Copy link
Member Author

@mariux is this good to go?

mariux
mariux previously requested changes Nov 2, 2022
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
Copy link
Member

@mariux mariux left a comment

Choose a reason for hiding this comment

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

defaults added.. please also adjust docs..

variables.tf Outdated Show resolved Hide resolved
variables.tf Outdated Show resolved Hide resolved
variables.tf Outdated Show resolved Hide resolved
variables.tf Outdated Show resolved Hide resolved
CHANGELOG.md Outdated Show resolved Hide resolved
@soerenmartius soerenmartius force-pushed the soerenmartius/commit-titles branch 2 times, most recently from 0e7c90a to 5a49d0b Compare November 4, 2022 14:14
@soerenmartius soerenmartius force-pushed the soerenmartius/commit-titles branch 4 times, most recently from 621847c to 76b9485 Compare November 4, 2022 14:43
@soerenmartius
Copy link
Member Author

@mariux the tests are failing after applying your provided suggestions ... not a priority though https://github.com/mineiros-io/terraform-github-repository/actions/runs/3394710192/jobs/5643646371

@mariux mariux closed this Nov 6, 2022
@mariux mariux reopened this Nov 6, 2022
Copy link
Member

@mariux mariux left a comment

Choose a reason for hiding this comment

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

lgtm

@mariux mariux marked this pull request as draft November 6, 2022 14:12
main.tf Outdated
Comment on lines 32 to 36
squash_merge_commit_title = local.allow_squash_merge ? var.squash_merge_commit_title == null ? try(var.defaults.squash_merge_commit_title, null) : var.squash_merge_commit_title : null
squash_merge_commit_message = local.allow_squash_merge ? var.squash_merge_commit_title == null ? try(var.defaults.squash_merge_commit_title, null) : var.squash_merge_commit_title : null
merge_commit_title = local.allow_merge_commit ? var.merge_commit_title == null ? try(var.defaults.merge_commit_title, null) : var.merge_commit_title : null
merge_commit_message = local.allow_merge_commit ? var.merge_commit_message == null ? try(var.merge_commit_message, null) : var.merge_commit_message : null

Copy link
Member

Choose a reason for hiding this comment

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

there is no condition when setting the fields.. we can always set them.

Copy link
Member Author

Choose a reason for hiding this comment

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

nope that's not correct, as you can see in this test run, allow_squash_merge xor allow_merge_commit need to be set to true for setting those values otherwise the API returns an error https://github.com/mineiros-io/terraform-github-repository/actions/runs/3394517816/jobs/5643205775#step:4:1092

Copy link
Member

Choose a reason for hiding this comment

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

the error is based on typos in the variable names.

Copy link
Member Author

Choose a reason for hiding this comment

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

Not sure if that's correct, did you see the error

Error: POST https://api.github.com/orgs/***/repos: 422 Repository creation failed. [{Resource:Repository Field: Code:custom Message:Sorry, you need to allow the squash merge strategy in order to set the default squash commit message title or message. (no_squash_merge_strategy)}]

Copy link
Member

Choose a reason for hiding this comment

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

comitted suggested changes to test... works ;) .... conflicts would need to be resolves and default set to null again... or remove the complex default handling as it's deprectaed now anyway.. ;)

main.tf Outdated Show resolved Hide resolved
@anthr76
Copy link

anthr76 commented Dec 29, 2022

Is this ready to be merged?

@gaima8
Copy link

gaima8 commented Apr 12, 2023

Is this PR still actually a draft, or once conflicts are resolved, is it ready for approval and merging?
Githubs default squash strategy grinds my gears.

Thanks

@bodgit
Copy link

bodgit commented Jul 27, 2023

Would be good to get this over the line. I can't even manually tweak the repository settings as the current release of this module resets the squash settings back to the defaults.

@marcjay
Copy link

marcjay commented Aug 21, 2023

I think this PR might be ready to review?

@marko-fabry
Copy link

marko-fabry commented Oct 9, 2023

Hello all! What is the ETA on merging this one? We forked it for the time being just for this PR and it seems to work as expected.

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.

8 participants