Skip to content

Conversation

@ricardoamador
Copy link
Contributor

@ricardoamador ricardoamador commented Sep 28, 2023

This is a fix to the way the default branch is collected. The code was wrongly checking for if the default branch was empty after the config was collected. It was never empty because a default value of main was assigned so that was used each time.

This changes the default branch to have a default value of 'default' and then we check against that value to get true default branch from the repo.

Example pull request of the fix: flutter/flutter#135692

List which issues are fixed by this PR. You must list at least one issue.
Fixes flutter/flutter#135670

If you had to change anything in the flutter/tests repo, include a link to the migration guide as per the breaking change policy.

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read the Flutter Style Guide recently, and have followed its advice.
  • I signed the CLA.
  • I listed at least one issue that this PR fixes in the description above.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or this PR is test-exempt.
  • All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel on Discord.

Copy link
Contributor

@sealesj sealesj left a comment

Choose a reason for hiding this comment

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

LGTM with question - why are the other default values commented out here?

requiredCheckRunsOnRevert,
}) : allowConfigOverride = allowConfigOverride ?? false,
defaultBranch = defaultBranch ?? 'main',
defaultBranch = defaultBranch ?? 'default',
Copy link
Contributor

Choose a reason for hiding this comment

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

config.repoDefaultBranch()?

Copy link
Contributor Author

@ricardoamador ricardoamador Sep 28, 2023

Choose a reason for hiding this comment

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

I am trying to avoid the config dependency at this level. Plus I did not want to hard code it as that should really be removed from config anyway.

@ricardoamador
Copy link
Contributor Author

@sealesj did not see your earlier comment. They were from something else that I had done but I guess they were never removed. They were not being used anywhere in the code.

@godofredoc
Copy link
Contributor

Are we still missing the constant update? I still see "default".

@ricardoamador
Copy link
Contributor Author

Sorry, forgot to push the change.

@ricardoamador ricardoamador added the autosubmit Merge PR when tree becomes green via auto submit App. label Sep 28, 2023
@auto-submit auto-submit bot merged commit 959d73e into flutter:main Sep 28, 2023
@ricardoamador ricardoamador deleted the not_landing_in_flutter_135670 branch October 4, 2023 18:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autosubmit Merge PR when tree becomes green via auto submit App.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

revert bot not landing reverts

3 participants