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

Fix UX consistency #3

Merged
merged 3 commits into from
Apr 20, 2022
Merged

Fix UX consistency #3

merged 3 commits into from
Apr 20, 2022

Conversation

alexevanczuk
Copy link
Contributor

@alexevanczuk alexevanczuk commented Apr 18, 2022

Summary (please read before review)

This fixes the issue from #2

TLDR: danger-packwerk can only leave GitHub comments where there is a visible diff in GitHub (this is a GitHub restriction). Since we don't want to leave top-level PR comments, this makes it so certain new violation additions can never show up in Github. Namely, if we add a new violation against a constant with existing violations, the existing constant may not be part of the diff.

I have two implementations, as separate commits, to fix this in this PR:

  1. I toggle between leaving the comment on the constant OR the file, with a preference for the constant if it's in the diff. I like this becuase I feel like the comment on the constant draws attention to that constant being the focus of attention. Although note the message will always contain information about the constant. I don't like this approach because its a lot more complex (leaving room for error and harder maintenance) and also exposes more in the public API (although I could probably address this with a different design).
  2. I simply always leave the comment on the new file. This simplifies things and is also a more consistent experience for the user. It simplifies the solution a bit too.

Do you prefer solution (1) or solution (2)? Let me know!

Commits

  • clean up common test setup
  • clean up let blocks
  • remove unnecessary context
  • add test case for single constant addition
  • add test for new reference against existing constant
  • fix test by changing behavior
  • add another test case
  • switch to simpler implementation
  • Revert "switch to simpler implementation"

@alexevanczuk alexevanczuk force-pushed the ae-fix-ux-inconsistency branch 2 times, most recently from 8b47c93 to 44bcac8 Compare April 18, 2022 15:54
@alexevanczuk alexevanczuk changed the base branch from main to ae-use-special-test-helper April 18, 2022 15:55
@alexevanczuk alexevanczuk force-pushed the ae-fix-ux-inconsistency branch from 44bcac8 to 3563ad4 Compare April 19, 2022 19:34
@alexevanczuk alexevanczuk changed the base branch from ae-use-special-test-helper to main April 19, 2022 19:35
Copy link
Collaborator

@shageman shageman left a comment

Choose a reason for hiding this comment

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

Simplicity of implementation pushes me to solution #2

@alexevanczuk alexevanczuk force-pushed the ae-fix-ux-inconsistency branch from 3563ad4 to 9078ba9 Compare April 19, 2022 19:37
@alexevanczuk
Copy link
Contributor Author

Simplicity of implementation pushes me to solution #2

Sounds good @shageman . I've dropped the revert of solution 2 and force pushed along with a commit to bump the version.

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.

danger-packwerk does not add an inline comment on deprecated_references.yml under some circumstances
2 participants