Exclude files from Bitbucket's new pull request experience

Tom Kane
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 29, 2019

Hello community!

I'm excited to share that we've released a new feature called Excluded files. You can now exclude files in large diffs on pull requests for which you are the admin, so the review process is easier for everyone involved.

To enable the new feature, go to the repository containing the pull request and click Settings > Excluded files in the Pull Requests section. Learn more.

Please note that for now, the Excluded files filter is only available in the new pull request experience.

Happy coding!

Tom

Bitbucket Developer

8 comments

kevingwynn-chg February 20, 2019

Super excited about the "Excluded files" feature - it's VERY needed as all our diffs are difficult to manage with package-lock.json changes.

HOWEVER, I cannot seem to get it to work. I have tried turning on "New pull request experience" but it has NO EFFECT on our PR's. I'm not sure why... is there an initialization time of some sort? I've tried turning it off and on, creating PR's after turning it on, to no avail. Can someone help?

Tyler T
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 21, 2019

As @Alastair Wilkes mentioned in your other post - this might be caused by toggling the feature for a team account versus a personal account. The "New pull request experience" feature can only be activated on a personal account level.

For others that have run into the same issue, please see this post: https://community.atlassian.com/t5/Bitbucket-questions/quot-New-pull-request-experience-quot-has-no-effect/qaq-p/1014162#M38857

kevingwynn-chg February 21, 2019

Thank you Tyler. Yep, that was the problem. I also had to clear cookies for BitBucket.org in order to see the new experience.

Robert Dailey May 2, 2019

It's completely pointless to still generate HTML for excluded files. I am trying to utilize Exclude Files to slim down a pull request that fails to load due to having 5000+ files. But because 99% of the files are in an excluded directory, *AND* those files still generate HTML which requires massive load time, the PR still won't load!

You should not generate UI or data for excluded files. Excluded files should not require processing of any kind. Why is the server/client code still having to process excluded files? How am I supposed to exclude our third party libraries directory so that it doesn't cause PRs to fail to load due to number of files?!

Tom Kane
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 20, 2019

Hi Robert,

I apologize that I wasn't notified of your message sooner.

Due to technical constraints, we filter out excluded files after the diff is calculated. In the future we plan to filter files before the diff is calculated but it will require changes and upgrades to underlying core components. The feature can still reduce the page to a reasonable size for all but the most massive PRs.

On the PR page you will see a placeholder card for each excluded file, which would result in a large page load if you have 5000+ files in a PR. Are you referring to these placeholder cards when you say the PR is "generat[ing] HTML for excluded files"? You shouldn't be seeing diffs for those excluded files unless you click the link in the placeholder card.

This information surely comes too late to help you with your large PR but I wanted to explain the reasoning.

Regards,

Tom

Robert Dailey August 21, 2019

Yes, I'm referring to the placeholder cards. I do not see diffs, so in that respect the feature is "working as intended", but my feedback is really to say that the feature, as designed, is not good enough for my specific use case.

Tom Kane
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 21, 2019

I would like to hear more about your specific use case.

Do you (and/or your team) intend to actually review this PR with 5000+ files? You want to approve the changes to files that aren't in the excluded directory?

Or are you using PRs as a way to merge a batch of changes but you aren't actually reviewing the diff?

Robert Dailey August 21, 2019

If I work on a feature where I modify our normal code, and add a new third party library in to support implementing this feature, there is now essentially two categories of changes: Changes to our own code, and addition of code that we do not own, maintain, or care to look at.

For changes to our own code, we do want to code review those changes. When we add a third party library, that's not our code, but still required to implement the feature. So we don't want to review that third party library code, but it is required to be in version control so it is available.

To keep feature development atomic, we merge everything in together. So really we use exclusions as a mechanism to ignore changes in our "Third Party" directory so that we're only code reviewing the changes to stuff we care about. Just because something is in version control doesn't mean I want to diff it.

The way I would do this on the command line is:

$ git diff origin/master -- :^ThirdParty

This means exclude any and all changes under the "ThirdParty" directory when I do my diff. Effectively, this is how I want exclusions to function in pull requests too. The PR should really just be our visual diff tool on the web. The part you are functionally missing here is the ability to provide a pathspec (the part after the `--`).

Like Tom Kane likes this
Luka Grdzelishvili June 13, 2019

Hello,
File excluding feature is awesome and we love it.
But, can I set global exclude settings for all repositories, which will merge with current repository settings while opening PR ? or internal settings may override global settings.
like *.Designer.cs or *.min.js files.

if no, are you planning to make it?

Luka Grdzelishvili June 21, 2019

@Tom Kane Hello, do you have any information about my question?

Tom Kane
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 20, 2019

Hi Luka,

I apologize that I wasn't notified of your message sooner.

Bitbucket does not currently support Excluded files settings for more than one repository at a time. One reason we chose to use a text field for the Excluded files setting is so that it's easy to copy/paste from one repository to another.

We may consider a setting that applies to several repositories in the future but we have no definite plans.

I hope that helps.

Tom

Luka Grdzelishvili August 20, 2019

Hello,
Thank you for reply.
I hope you will add this in global settings.

Jakub Sroczyk September 4, 2019

Hello guys, that's a great feature.
Is this available on the server version? If not, do you think it will be implemented soon?

Like Krzysztof Zych likes this
Bryan Turner
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 4, 2019

@Jakub Sroczyk

I'm one of the Bitbucket Server developers. Excluding files is not available in Server, and is not on our current roadmap. BSERV-9951 is a feature request for it, but it's not very active or highly requested. Since Bitbucket Server doesn't show all of its diffs on a single page, like Bitbucket Cloud does, such filtering really only impacts the change tree; users already don't have to view diffs for individual files they don't find interesting, or pay (most of) the performance cost of loading them.

If this feature is important to you, I'd encourage you to vote for the issue and to detail your use case. Use cases are important for helping PM evaluate the potential benefits of shipping an improvement.

Best regards,
Bryan Turner
Atlassian Bitbucket

Simon Bromberg October 30, 2019

Hi, how do you add tasks using the new PR UI? Is that feature not yet available?
Also, is there any way to get the old behaviour where if you delete a comment (with no children) the comment is completely removed without leaving the comment with the text "This comment has been deleted by its author"?

Paz
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 31, 2019

Hi Simon,

In the right sidebar, in the "Early Access Preview" panel, you can temporarily switch to the old UI.

2019-10-31_10-41-04.png

Or add ?spa=0 to end of a URL to get the same effect. 

Hope this helps.

Simon Bromberg October 31, 2019

I know I can switch back to the old UI, but my question is about the new UI. I also noticed there's no way to like a comment anymore, is that not coming back? 

Matthew Shaile April 16, 2020

Doesn't seem to work at all for me.
I added exclude rules after creating a PR, do I have to do it before or something?
Also the PR has 200 files (most I am trying to exclude), so I do get the "Pull request is too large to display" message - is that preventing the exclude from working? If so it makes exclude next to useless

Tom Kane
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 16, 2020

Hi @[deleted],

While there is a limit of 200 files for a PR, excluded files aren't counted against that limit.

Adding or updating rules after creating a PR should have an immediate effect when you refresh the PR view. It's a long shot but maybe try a hard refresh in case you have some local caching.

Can you confirm in your Labs settings that you've turned on the New pull request experience feature for your account? Note that turning the feature on for a team does not work.

Hope that helps!

Colin Mierowsky May 28, 2020

I am not able to get this to work. I do have the new experience working (and it's great) but the excluded files are still showing in my PR's.

 

I have a single line in the exclude section for generated files

*.auto.cs

but I still see these files in the PR. Is there something I am not doing correctly?

pr.png

Tyler T
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 28, 2020

The files will still appear in the sidebar, but they will be collapsed by default in the diffs view. When you load a PR, are these files still expanded in the main diff view?

Colin Mierowsky May 28, 2020

They are not expanded, i misunderstood the feature in that I thought they would be excluded from the sidebar too. Thanks for the quick response and clarification.

Like Tyler T likes this
Tyler T
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 28, 2020

You're welcome! If they were completely hidden that could potentially cause problems when pull requests are approved and merged. The idea of the future is to hide the expanded diff which helps with code review and page performance.

Cheers

Diego Chiodini July 7, 2020

You could just group those files into a collapsed tab on the sidebar and made those visible only if the user click on it.

It is counter-intuitive to call a feature EXCLUDE when you in fact, just collapse the view of those files.

Like Brady Lockhart likes this
Brian L Walker November 19, 2020

I agree.  It doesn't make sense to still have it in the list if it is excluded.  The value for me would be for it to not be counted to towards the overall quota of PR files which determines the file display (list or one by one -- which I do NOT like).

Brady Lockhart December 14, 2022

I agree with others here that the file tree in the sidebar is a crucial place where I hoped this feature would have an impact.

Even something as simple as changing the appearance of excluded file names in the sidebar -- like with a strikethrough, a recognizable icon, or a different color/highlight -- would be a huge improvement to the PR experience.

Ryan Brown August 1, 2022

Is this feature only on the cloud and not on prem?

Comment

Log in or Sign up to comment
TAGS
AUG Leaders

Atlassian Community Events