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

[BUG] cocogitto-bot not honoring the ignore_merge_commits configuration #15

Closed
luciidlou opened this issue Aug 8, 2023 · 10 comments
Closed
Assignees
Labels
bug Something isn't working

Comments

@luciidlou
Copy link

Describe the bug
The cocogitto bot is not ignoring commit messages that follow the Merge branch 'main' into <some-branch-name> pattern. This is typically the commit message pattern that gets automatically produced when using GitHub's Update Branch button in the UI.

To Reproduce
Steps to reproduce the behavior:

  1. Create new branch off of main.
  2. Push any change up on your new branch and open a PR.
  3. Update main with a change.
  4. Select Update Branch on your PR in the GItHub UI (this syncs your working branch with main).
  5. Cocogitto bot should yell about the commit message that gets automatically created.

Expected behavior
The bot is expected to ignore the commit message described above.

Additional context
The repo does have a cog.toml with the ignore_merge_commits = true configured. I've also attached some screenshots to add further context. The repo is private, so it cannot be linked.
Screen Shot 2023-08-07 at 2 42 53 PM
Screen Shot 2023-08-07 at 2 42 41 PM

@luciidlou luciidlou added the bug Something isn't working label Aug 8, 2023
@the-wondersmith
Copy link
Contributor

@oknozor in the spirit of full disclosure @luciidlou and I coworkers and the private repo he's referencing is one of ours.

@luciidlou I 100% spoke incorrectly when I was explaining and said that the default behavior of the bot was to ignore merge commits - that was the default behavior prior to the recently PR that replaced conventional_commit_parser with cocogitto directly. The default cocogitto configuration is to not ignore merge commits and if there is no cog.toml in the target repo, the bot will now use the default for Settings.

@oknozor should I put up another PR to change the bot's config creation to something like:

// Parse the config file into Cocogitto `Settings` (falling
// back to the default if the target repo doesn't have a `cog.toml`)
let cog_config = Settings::try_from(cog_file).unwrap_or_else(|_| Settings {
    ignore_merge_commits: true,
    ..Settings::default()
});

??

@the-wondersmith
Copy link
Contributor

@oknozor Actually... this might be an issue too. That should probably be either the repo-specific "main", the branch the PR is being merged into, or the branch that's being merged from. Not actually sure which without some more thought...

@the-wondersmith
Copy link
Contributor

@oknozor PR is up

I was able to verify proper parsing behavior of committed cog.toml files as well, so I think that should fix the actual code issue(s)? I'm gonna have to lean on your expertise for whether or not anything else might be amiss to cause the observed behavior.

There's no chance it's something like "existing repos need to re-auth the bot to get the updated version" or something, is there?

@the-wondersmith
Copy link
Contributor

@oknozor Bump

@the-wondersmith
Copy link
Contributor

@luciidlou The fix PR for this looks to be merged. Would you be so kind as to verify that it now works as expected?

@luciidlou
Copy link
Author

@oknozor Hey there! The PR @the-wondersmith linked above looks like it was merged, but we are still seeing the same issue today (see screenshot). Do we need to remove and re-add cocogitto-bot to any existing repos in order for the changes to take place? Or is there some central deployment that needs updating? Or does the PR that was merged simply just not solve the problem?
Screenshot 2023-08-23 at 1 42 19 PM

@oknozor
Copy link
Contributor

oknozor commented Aug 26, 2023

Hey, I am not home right now and I don't have access to the cluster where the bot is deployed. I will check the deployment next week.

@luciidlou
Copy link
Author

@oknozor bump

@the-wondersmith
Copy link
Contributor

@oknozor bumping again

@oknozor
Copy link
Contributor

oknozor commented Sep 25, 2023

Hey, this should be working, can you close/reopen your pull request.
I am not able to reproduce this behavior (see: cocogitto/cocogitto_bot_playground#18).

If this is still an issue can you provide a simple reproducer on a public repository ?

@oknozor oknozor closed this as completed Dec 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants