Closed 0x4007 closed 4 months ago
@wannacfuture this is yours to take
Just did a test. Once not linked, and once linked. https://github.com/pavlovcik/link-pulls/blob/development/static/link-pull.ts
m1:static nv$ yarn tsx static/link-pull.ts
yarn run v1.22.21
$ /Users/nv/repos/pavlovcik/link-pull-request-prototype/node_modules/.bin/tsx static/link-pull.ts
Trace: { isLinked: true }
at main (/Users/nv/repos/pavlovcik/link-pull-request-prototype/static/link-pull.ts:53:13)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
✨ Done in 1.47s.
m1:static nv$
@pavlovcik I already stumbled upon this before, and the problem with cross-referenced
is that referencing another issue in a comment also creates that same event. connected
does not always happen either, depending on some scenarios. I've seen somewhere that the GraphQl API actually does make it possible to retrieve, but didn't test myself. Second problem is that the timeline is paginated and could eventually get tedious to parse. I can have a look if @wannacfuture has something else on his plate.
@pavlovcik the deadline is at 2024-02-29T11:24:28.919Z
I guess I technically finished implementing this already at https://github.com/ubiquibot/conversation-rewards
Which is a brand new codebase with tests for this.
+ Evaluating results. Please wait...
View | Contribution | Count | Reward |
---|---|---|---|
Issue | Specification | 1 | 99 |
Issue | Task | 1 | 300 |
Issue | Comment | 3 | 24.4 |
Issue | Comment | 3 | 0 |
Comment | Formatting | Relevance | Reward |
---|---|---|---|
Our old approach involved scraping the DOM from a public issue v... | 99h3: count: 3 score: "3" words: 4 code: count: 7 score: "7" words: 7 | 1 | 99 |
@wannacfuture this is yours to take... | 1.2 | 0.81 | 1.2 |
Just did a test. Once not linked, and once linked. https://git... | 18.2code: count: 1 score: "1" words: 0 | 0.71 | 18.2 |
I guess I technically finished implementing this already at http... | 5 | 0.775 | 5 |
@wannacfuture this is yours to take... | - | 0.81 | - |
Just did a test. Once not linked, and once linked. https://git... | -code: count: 1 score: "0" words: 0 | 0.71 | - |
I guess I technically finished implementing this already at http... | - | 0.775 | - |
View | Contribution | Count | Reward |
---|---|---|---|
Issue | Comment | 1 | 10.4 |
Comment | Formatting | Relevance | Reward |
---|---|---|---|
@pavlovcik I already stumbled upon this before, and the problem ... | 10.4code: count: 2 score: "2" words: 3 | 0.62 | 10.4 |
Our old approach involved scraping the DOM from a public issue view. This does not work on private repositories (we could not extract an auth token from the app private key authenticated octokit client.)
After some research by @wannacfuture and I, we came to the conclusion that the only way to do this is to read the events of an issue and pull request e.g. https://api.github.com/repos/ubiquibot/production/issues/77/timeline https://api.github.com/repos/ubiquibot/production/issues/78/timeline
And cross reference the
connected
orcross-referenced
events e.g.Issue
Pull Request
We can see that the only thing matching here is the
created_at
property.Be sure to invalidate pairing disconnected and un-cross-referenced events (not sure the exact names.)
Glossary
connected
refers to when a collaborator selects the issue from the pull request UI (sidebar)cross-referenced
is when a contributor who opens the pull request, opens with a "closing" keyword e.g. Resolves #1234