Skip to content

Update github extension#8967

Merged
thomaslombart merged 4 commits intoraycast:mainfrom
aeither:ext/github
Nov 6, 2023
Merged

Update github extension#8967
thomaslombart merged 4 commits intoraycast:mainfrom
aeither:ext/github

Conversation

@aeither
Copy link
Contributor

@aeither aeither commented Oct 25, 2023

Description

Added My Latest Repositories Command to show my latest Github respositories in descending order.

Screencast

CleanShot 2023-10-25 at 23 33 53@2x

Checklist

- add my latest repositories
- add latest repositories graph query
@raycastbot
Copy link
Collaborator

raycastbot commented Oct 25, 2023

Thank you for your contribution! 🎉

🔔 @thomaslombart @unnamedd @tonka3000 @khasbilegt @pernielsentikaer @loxygenK @oilbeater @LunaticMuch @aeorge @daquinoaldo @peppy you might want to have a look.

@thomaslombart thomaslombart added extension: github Issues related to the github extension and removed extension: raycast/github labels Oct 26, 2023
@Angelk90
Copy link

@aeither : Some considerations:

I tried the code, the current repository what is displayed in the list on raycast does not correspond to what I see by going to my profile on repositories.

Sorting should not be based on the last update which could be a commit as well as a description change.

I also tried editing on myLatestRepositories using PUSHED_AT and CREATED_AT, changing DESC to ASC, but the result never changes, it just stays the same.

Some dates of the last update on some repositories do not seem to match, between those on raycast and those displayed on github repositories.

@aeither
Copy link
Contributor Author

aeither commented Oct 26, 2023

@aeither : Some considerations:

I tried the code, the current repository what is displayed in the list on raycast does not correspond to what I see by going to my profile on repositories.

Sorting should not be based on the last update which could be a commit as well as a description change.

I also tried editing on myLatestRepositories using PUSHED_AT and CREATED_AT, changing DESC to ASC, but the result never changes, it just stays the same.

Some dates of the last update on some repositories do not seem to match, between those on raycast and those displayed on github repositories.

Thanks for noticing the difference between the Github GraphQL query and github profile repositories.
So I just tried with several more queries

As you can find under profile repositories filter. It is sort by last updated by default.

CleanShot 2023-10-26 at 18 42 13@2x

That's why I tried with updatedAt. Actually my first try was with search.

query {
  search(
    type:REPOSITORY,
    query:"sort:updated owner:YOUR_USERNAME",
    first: 10
  ) {
    nodes{
        ... on Repository {
          name,
					# ...THE REST OF THE VALUES
        }
    },
  }
}

But it is a long query, I wanted something where I can just hit enter to see my latest repositories. I have noticed that under profile repositories it include repos like those that are updated not by you. for example: updated by dependabot and forked repositories also as you mentioned there is mismatch in date.

Regarding the dates, In Raycast the date comes from repository updatedAt.

After few more attempts. To reflect better raycast my latest repos with profile repositories from github.com I changed to PUSHED_AT and also updated the the date to pushedAt. In this way, it also shows repositories where is updated by dependabot and forks which weren't showing with UPDATED_AT. Also the dates should be also the same now that it comes from pushedAt.

@Angelk90
Copy link

Angelk90 commented Oct 26, 2023

@aeither : I get the following error:

Screenshot 2023-10-26 alle 21 36 53

Error is due to this part of code:
repository.updatedAt = repository.pushedAt;

Sometimes it gives an error, other times it doesn't, when it is inserted.

@aeither
Copy link
Contributor Author

aeither commented Oct 27, 2023

@Angelk90 updated

@Angelk90
Copy link

@aeither: It works even without having to put the isPushedAt as an attribute of RepositoryListItem.

Strange things happen, I don't understand why, but at the moment it doesn't cause any problems.

it happened a few times then not anymore.

I don't understand how history is supposed to work.

P.s.
Are you on the slack channel?

@aeither
Copy link
Contributor Author

aeither commented Oct 29, 2023

I am on raycast slack but I don't open it often as I don't use Slack.

@thomaslombart
Copy link
Contributor

@aeither I get the need for this command but there's already a command called Search Repositories to find repositories. There you can select My Repositories in the dropdown to see your repositories. It may makes sense to add the "latest" option there.

@aeither
Copy link
Contributor Author

aeither commented Oct 31, 2023

@thomaslombart Hey Thomas.

First, It serves a different purpose. with search repositories is for when I already know what I am looking which is why there is a search bar where I can filter and look for the term I already have in mind. With latest, I don't know what is the name but I know I commit to it recently so I can find the repo with the command without any term in mind.

Putting my latest inside search make it less intuitive for new users as the name search repositories doesn't indicate immediately it can also list your latest repositories.

I also use search repositories. Putting my latest repos inside make me have to move back and forth in the dropdown so after I searched for something I have change in the dropdown back to my latest repos and viceversa.

Putting latest option inside search also means adding technical complexity. The graphQL query for search repos is different from my latest repos.

@Angelk90
Copy link

@aeither : You can tell me what name I can find you with on Slack or if you prefer another Discord channel or Twitter.

Copy link
Contributor

@thomaslombart thomaslombart left a comment

Choose a reason for hiding this comment

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

Fair enough! 🙂

Could you add an entry in the CHANGELOG.md file though? Here's our guidelines about that: Version History.

@thomaslombart thomaslombart merged commit 35761ca into raycast:main Nov 6, 2023
@raycastbot
Copy link
Collaborator

Published to the Raycast Store:
https://raycast.com/raycast/github

@raycastbot
Copy link
Collaborator

🎉 🎉 🎉

We've rewarded your Raycast account with some credits. You will soon be able to exchange them for some swag.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

extension fix / improvement Label for PRs with extension's fix improvements extension: github Issues related to the github extension

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants