Skip to content

fix: #221 filtered issues in archived repositories#223

Merged
dlvhdr merged 2 commits intodlvhdr:mainfrom
yokishava:fix/filtered-arvhived-repositories-issues
Jan 19, 2023
Merged

fix: #221 filtered issues in archived repositories#223
dlvhdr merged 2 commits intodlvhdr:mainfrom
yokishava:fix/filtered-arvhived-repositories-issues

Conversation

@yokishava
Copy link
Contributor

Summary

I've tried to filter archived pull requests before, but I saw this issue
We have done the same for issues in archived repositories.

#221

I also saw a comment that the code was becoming redundant. I considered modifying the code to take that into account, but decided against it because the scope of the change would be too large.

How did you test this change?

  • remove excludeArvhicedPullRequests in prsection.go
  • remove sort in prsection.go and issuesection.go
  • filtered issues and sorted issues in FetchIssues
  • filtered pull requests and sorted pull requests in FetchPullRequests
  • remove test.yaml in github workflows

Images/Videos

before
スクリーンショット 2023-01-17 19 14 08

after
スクリーンショット 2023-01-17 19 14 44

I used this repository to check if archived issues are filtered.
https://github.com/yokishava/element

@robdimsdale
Copy link
Contributor

This is almost exactly what I was planning on doing to address #221 - thank you for beating me to it, @yokishava !

I am curious to learn more about why you removed the test. I was planning on adding a test to issuesection (or issueapi) similar to what you previously added for PRs. But I see you removed it.

I think there's still value in testing the archived/sort functionality - do you agree ? If so, should we add the test back in?

@yokishava
Copy link
Contributor Author

Thank you for comment!

The reason for removing the tests is that the changes made it harder to write tests.

You are right that it would be better to have tests, but if we are going to write tests, I think we need to make more changes to FetchIssue and FetchPullRequests to get there. I have lowered the priority of the tests to reduce the scope of the changes.

If you still think it would be better to have tests, I would be happy to modify them too.

@robdimsdale
Copy link
Contributor

The reason for removing the tests is that the changes made it harder to write tests.

Ah, yes. The issueapi/prapi is tightly coupled to the GitHub api, so in order to test the archiving and sort functionality, we'd either have to refactor the relevant functions to consume a mockable interface, or we'd have to commit to integration-testing against a real, archived, repository.

I agree that both of those seem out of scope for this change, so I agree with removing the tests.

@dlvhdr
Copy link
Owner

dlvhdr commented Jan 18, 2023

I'm good with this as well.

dlvhdr
dlvhdr previously approved these changes Jan 18, 2023
data/issueapi.go Outdated
issues = append(issues, node.Issue)
}

sort.Slice(issues, func(i, j int) bool {
Copy link
Owner

@dlvhdr dlvhdr Jan 18, 2023

Choose a reason for hiding this comment

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

Can you please create an issue that removes the sorting code, and adds a default sort:updated like in https://docs.github.com/en/search-github/getting-started-with-searching-on-github/sorting-search-results#sort-by-updated-date

Copy link
Contributor

@robdimsdale robdimsdale Jan 18, 2023

Choose a reason for hiding this comment

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

I'm not sure I follow the reference - this PR is #223 and when I searched existing issues and PRs for sort I don't see any other issue that I could reference.

Copy link
Owner

@dlvhdr dlvhdr Jan 18, 2023

Choose a reason for hiding this comment

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

I swear I pasted a link to the Github filters docs and not an issue number :D

Copy link
Contributor

Choose a reason for hiding this comment

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

done: #225

Copy link
Contributor Author

@yokishava yokishava Jan 19, 2023

Choose a reason for hiding this comment

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

Thanks for review!
I removed soting codes.
I added sort qualifier to makeIssuesQuery and makePullRequestsQuery .

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.

3 participants