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

Check that linked issues are open #3277

Merged
merged 35 commits into from Oct 17, 2023

Conversation

KrishnaSindhur
Copy link
Contributor

@KrishnaSindhur KrishnaSindhur commented Aug 29, 2023

Description

Closes #2733.

Readiness checklist

  • I added/updated unit tests (and they pass).
  • I added/updated integration/compatibility tests (and they pass).
  • I added/updated comments and checked rendering.
  • I made spot refactorings.
  • I updated user documentation.
  • I ran task all, and it passed.
  • I ensured that PR title is good enough for the changelog.
  • (for maintainers only) I set Reviewers (@FerretDB/core), Milestone (Next), Labels, Project and project's Sprint fields.
  • I marked all done items in this checklist.

@KrishnaSindhur KrishnaSindhur marked this pull request as draft August 29, 2023 14:43
@codecov
Copy link

codecov bot commented Aug 29, 2023

Codecov Report

Merging #3277 (f35022e) into main (5034b84) will decrease coverage by 0.14%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3277      +/-   ##
==========================================
- Coverage   61.65%   61.51%   -0.14%     
==========================================
  Files         426      426              
  Lines       27399    27399              
==========================================
- Hits        16892    16855      -37     
- Misses       9506     9540      +34     
- Partials     1001     1004       +3     

see 10 files with indirect coverage changes

Flag Coverage Δ
filter-true 58.06% <ø> (-0.13%) ⬇️
hana-1 ?
integration 58.06% <ø> (-0.13%) ⬇️
mongodb-1 4.50% <ø> (ø)
postgresql-1 41.26% <ø> (+0.03%) ⬆️
postgresql-2 41.79% <ø> (ø)
postgresql-3 40.10% <ø> (+0.04%) ⬆️
sort-false 58.06% <ø> (-0.13%) ⬇️
sqlite-1 41.07% <ø> (-0.10%) ⬇️
sqlite-2 41.97% <ø> (ø)
sqlite-3 40.07% <ø> (-0.03%) ⬇️
unit 22.40% <ø> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

@KrishnaSindhur KrishnaSindhur marked this pull request as ready for review September 1, 2023 02:29
@AlekSi AlekSi added the code/chore Code maintenance improvements label Sep 1, 2023
@AlekSi AlekSi added this to the Next milestone Sep 1, 2023
Copy link
Member

@AlekSi AlekSi left a comment

Choose a reason for hiding this comment

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

Could you please add tests to testdata.go with an open and closed issue? If implemented correctly, they will show that this code doesn't detect closed issues correctly

@KrishnaSindhur
Copy link
Contributor Author

@AlekSi I realised now there in no clear way to find issue open or closed by issue url like we used in our test, is there any better way?

@AlekSi
Copy link
Member

AlekSi commented Sep 4, 2023

I think we could use the GitHub API via https://github.com/google/go-github. We have some examples there: https://github.com/FerretDB/github-actions/blob/main/conform-pr/main.go

@AlekSi AlekSi modified the milestones: v1.10.0, Next Sep 14, 2023
@AlekSi
Copy link
Member

AlekSi commented Sep 18, 2023

@KrishnaSindhur, any news? Anything we could help you with?

@KrishnaSindhur
Copy link
Contributor Author

Will raise a PR shortly!!

@AlekSi AlekSi modified the milestones: v1.11.0, Next Sep 25, 2023
@KrishnaSindhur
Copy link
Contributor Author

@AlekSi this PR is like draft just want to know how to test locally? github token is required to test it locally and some repo information please check!!

@KrishnaSindhur KrishnaSindhur marked this pull request as draft September 25, 2023 16:07
Copy link
Member

@AlekSi AlekSi left a comment

Choose a reason for hiding this comment

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

Tests fail because they are getting URLs like https://api.github.com/repos/owner/https://github.com/FerretDB/FerretDB/issues/2733. They don't look valid :)

@KrishnaSindhur
Copy link
Contributor Author

what we should do if we have below URL? should we ignore or catch it?
https://api.github.com/repos/owner/https://github.com/FerretDB/FerretDB/issues/2733

@AlekSi AlekSi self-requested a review October 9, 2023 05:46
@AlekSi AlekSi removed this from the v1.12.0 milestone Oct 9, 2023
@AlekSi AlekSi added the not ready Issues that are not ready to be worked on; PRs that should skip CI label Oct 9, 2023
@AlekSi
Copy link
Member

AlekSi commented Oct 9, 2023

we have to remove // want

That would be the equivalent of removing a test, and we want to keep that test. Let's find some other solution. For example, we could remove // want … part if the file name is testdata.go.

Let's also gather all URLs first, remove duplicates, and then check them. Right now we check the same issue multiple times, quickly running over a rate limit for unauthenticated requests.

@AlekSi AlekSi removed the not ready Issues that are not ready to be worked on; PRs that should skip CI label Oct 9, 2023
Copy link
Member

@AlekSi AlekSi left a comment

Choose a reason for hiding this comment

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

@AlekSi AlekSi changed the title add: issue url check open or closed Check that linked issues are open Oct 9, 2023
@KrishnaSindhur
Copy link
Contributor Author

@AlekSi should i make change to remove? this should be check in todo statement to check file name something and then avoid // want ..

// want … part if the file name is testdata.go.

so then how do we check for duplicate issue without a api hit?

@AlekSi
Copy link
Member

AlekSi commented Oct 10, 2023

so then how do we check for duplicate issue without a api hit?

By collecting already checked URLs and not checking the same URL twice

@AlekSi AlekSi mentioned this pull request Oct 17, 2023
9 tasks
@AlekSi AlekSi added this to the Next milestone Oct 17, 2023
@AlekSi AlekSi self-requested a review October 17, 2023 07:49
@AlekSi AlekSi enabled auto-merge (squash) October 17, 2023 09:07
@AlekSi
Copy link
Member

AlekSi commented Oct 17, 2023

Thank you for all the hard work!

@AlekSi AlekSi disabled auto-merge October 17, 2023 09:08
@AlekSi AlekSi merged commit 3d3eb82 into FerretDB:main Oct 17, 2023
28 of 30 checks passed
@KrishnaSindhur
Copy link
Contributor Author

hey sorry i was occupied with some other things could not spend time last 2 weeks
@AlekSi

@AlekSi
Copy link
Member

AlekSi commented Oct 19, 2023

No worries! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code/chore Code maintenance improvements
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Make linter for checking that linked issues are open
2 participants