-
-
Notifications
You must be signed in to change notification settings - Fork 368
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
Support inline comments #77
Comments
So, from my perspective, I think sticky is something we should avoid. Every Dangerfile that we have at Artsy had sticky turned off on each trigger, which is why I turned it off by default. Unless someone really, really, really wants it, we should avoid it. It adds a considerable amount of internal complexity (finding all pre-existing violations in every comment / issue before incrementally updating/removing them) on Danger for an occasionally useful feature. So,
Both of those would work (and be backwards compatible) I think I'm in favour of the options hash. Gives more room for further improvement in the future without making a lot of args on those functions. Generally the usage of Implementation: I see two options here, you can start a review, and make the comments inside there ( see this discussion on what that could look like ) or just outright use the commit API. Either way, there needs to be
This is by far the most gnarly code in Danger-rb, so I advise taking your time on it and trying to find better abstractions than we have in ruby. |
Regarding danger/danger#684, I'm thinking adding a GitHub review feature could be separate from just adding a Thanks for posting links and explaining the PR Diff positioning system - they will be useful for understand how to parse the diff. A coworker went through a similar experience trying to parse GitHub diffs for an Android static analysis tool he and another coworker have been working on, so I think those could also be some helpful references. I'm thinking the diff parser could be added to this repo, and if generic enough, it could be pulled out into an npm package for reuse - I didn't see anything when searching npmjs.com that did quite what we need here. |
We do already have a diff parser in Danger JS - here but what I mean is WRT the diff parser is: You need to take an absolute file path + line, e.g. Other than that, all sounds fine to me 👍 |
Thanks @orta, think I misunderstood about the diff parsing thing originally. I'll dive into the code and get my hands dirty. Will open a PR if I have any more questions. 😄 |
This issue is open if someone would like to contribute! An initial attempt to solve this was in #99, which might give a starting point. Feel free to comment here to ask more questions or open a PR to get work-in-progress feedback. 😃 |
I would be pleased to help on this. At www.bam.tech, we want to use danger as a poka-yoke, to share good practice and learning accros the teams. Inline comment have a big impact on it. That being said, I have a bad overview of danger js, so maybe it is to complicated for a first task. My plan so far:
Does it seems a good plan for you ? What are the difficult points / points to carefully design the abstraction ? |
That feels about right, yeah 👍 Here's the main chunk of the work in danger ruby. I've slowly grown to the idea that I want to see something like #196 which will end up requiring the "did this danger instance create this table" but that's further down the line. Most of the work is in deciding where a comment should go, and making sure every comment is up-to-date when danger does a second run |
Thanks for looking into this, @tychota!
If it's possible to weave GitHub reviews and inline comments together through some API configuration option, that sounds awesome. I guessed that inline commenting would be the simplest first step, but I'm not familiar with GitHub's API on either of these things, so I'm not sure what would be doable in one PR. For reference, here is the Ruby PR where the GitHub reviews feature was introduced in Danger - danger/danger#702. |
Any progress on this? |
Wow. |
ah yeah! This can be closed 👍 |
Danger-rb's methods support the following parameters:
These methods allow for adding a warning/error/messages inline on a specific file. What would be involved in porting that functionality to Danger-js?
The current type definition of
warn
in Danger-js is:Could we just add more parameters? Would we accept an options object as a second parameter?
Also, where would
sticky: Boolean
come into play - would that be a part of this work, or should that be a part of a separate issue?The text was updated successfully, but these errors were encountered: