Skip to content

Fix --fail-above with --exclude. #11306

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

Merged
merged 3 commits into from
Oct 22, 2021
Merged

Conversation

marcandre
Copy link
Contributor

This PR deals with exclusions once, which simplifies the code.

@marcandre
Copy link
Contributor Author

New test was failing, as the count for fail-above was 6 instead of 1.

@josevalim
Copy link
Member

Hi @marcandre!

It is worth noticing there is a difference in behaviour here. You are filtering now before we analyze the graph, which means that transitive dependencies through that node are no longer caught, while before it would simply remove those nodes from the results (with the exception of :compile_connected but perhaps that shouldn't consider excluded either).

We should discuss if we really want to make this change.

@marcandre
Copy link
Contributor Author

Indeed. I do not know which is most useful/intuitive.
I'm using --exclude currently to remove dependencies that disappear in Phoenix 1.6. I think either ways give me the same result.
I'll make a different PR to fix the count without changing the behavior

@josevalim
Copy link
Member

Hi @marcandre, just a heads up we plan to have a release candidate next week, in case you want to see this included. :)

@marcandre
Copy link
Contributor Author

Thanks! Yes, I definitely want to fix that bug, so I'll have a separate fix by then.
As I'm using excluded strictly with compile_connected, I really can't think of a use case where there would be a difference in behavior (and thus argue one way or the other).

@marcandre
Copy link
Contributor Author

marcandre commented Oct 20, 2021

I'll first start to write a test, because I'm not sure how this PR differs. At least for format "dot/plain/pretty", we go through the graph using callback and excluded references stop the processing.

Or did you mean that the change was for "stats" and "cycles"? Are those meant to be compatible with excluded? I'd tend to say that doing the actual filtering as proposed here might be a good option.

@josevalim
Copy link
Member

@marcandre imagine a.ex depends on b.ex which depends on c.ex. My understanding is that, by filtering early, we will now no longer show c.ex at all. By filtering earlier, I think c.ex still appears in the "end result", just not linked to anything.

I may be misremembering the behaviour. But that's what I think is the difference. It should appear on any kind of graph.

@marcandre
Copy link
Contributor Author

I rebased this branch on #11330, to show that the particular example of 3 "linear" dependencies (as I understood it) does not change with this PR (with or without a --source).

Is there a different scenario that I should be testing?

@josevalim josevalim merged commit 06594f5 into elixir-lang:master Oct 22, 2021
@josevalim
Copy link
Member

💚 💙 💜 💛 ❤️

@marcandre marcandre deleted the exclude branch October 22, 2021 15:47
@marcandre
Copy link
Contributor Author

Great, thanks!

@marcandre
Copy link
Contributor Author

marcandre commented Nov 30, 2021

@josevalim Looks like this was not backported correctly to the 1.13 branch?

06594f5 only includes a test, while as 7efd70b28 includes the code fix and the test. Looks partly my fault, as my test appears not to be sufficient to reveal the issue...

Nevermind, I had an out of date master branch which has been renamed main. All is well, sorry for the noise.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants