GithubHelp home page GithubHelp logo

Comments (11)

darkwing avatar darkwing commented on August 30, 2024

I was thinking about this, and thinking we could read all comments from our bot and delete them via the API, but if they have replies, that would mess things up.

from discord.

Faeranne avatar Faeranne commented on August 30, 2024

I do believe that we can access just the most recent commit, but since PR comments occur on the merge commit that may confuse things. Any reason we shouldn't re-comment on issues in the PR?

from discord.

darkwing avatar darkwing commented on August 30, 2024

My issue is that let's say a PR goes back and forth a dozen times...do we want a dozen comments for the same change for each update/commit? It's too much noise, IMO. We should at least dig for a better solution.

from discord.

Faeranne avatar Faeranne commented on August 30, 2024

We could just ignore files that haven't changed in the last commit. Those that have will loose the original; comments, so we will need to re-comment if they haven't been fixed.

from discord.

openjck avatar openjck commented on August 30, 2024

Lines that change will lose their comments, but only those lines. So re-commenting on files that have changed won't be enough.

from discord.

Faeranne avatar Faeranne commented on August 30, 2024

The latest commit should only have lines that have changed. Perhaps we use only the latest commit to determine which lines have changes, and build comments from that? Since we would still have merge commit numbers, it should only be one additional call to github to fetch the latest commit diff.

from discord.

openjck avatar openjck commented on August 30, 2024

We'll also need to handle the case where someone rewrites the history of a branch.

I wonder if we might be over-thinking it. Would something as simple as not adding a comment if one already exists work?

from discord.

Faeranne avatar Faeranne commented on August 30, 2024

What if someone else made a comment on the line? I agree that it seems like there should be a simpler answer, but i'd bet that we could release a fix with what we have now.

As for branch rewrites? I believe Github will clear all comments when that happens, so we use the latest commit, which should have all the changes again. This is one of the reasons I feel that rewriting history should be saved for the actual PR merge, or not executed at all, but it's definitely a problem we need to solve.

from discord.

Faeranne avatar Faeranne commented on August 30, 2024

If #89 gets completed, we can use the db to track comments easily.

from discord.

openjck avatar openjck commented on August 30, 2024

This can be triggered by a few things, including but not limited to rebasing a commit, adding a new commit to the same branch, and closing/reopening a pull request.

from discord.

openjck avatar openjck commented on August 30, 2024

Quoting @groovecoder from #151:

@openjck and I thought a solution may be:

  1. Create a comments table in our shiny new postgres database
  2. Update the comment code to store a hash of the url, file name, line number, and line contents
  3. Before making a comment, make sure there isn't already a comment record with the same hash

That file name, line number, and line contents combination seems to be the same keys that GitHub uses to decide whether to collapse comments in the PR interface. But we can tweak the hash components as needed.

from discord.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.