Way to change or add another version of a package #7
Replies: 1 comment 1 reply
-
I'm not interested in adding this as a feature as I'm a novice with GraphQL myself and don't have a use for prerelease versions, but I'm happy to give you some direction on what you'd need to do to get prerelease versions! Through the REST APIYou may want to do this through the REST API, which is an easier API to work with. It gets more data than you need though, and there's a rate limit if you don't provide a token (I never got around to this, maybe you want to add it?) so it's not perfect, but it's simpler. To use it with the script, don't provide a GITHUB_TOKEN: autocopr/.github/workflows/update.yml Lines 47 to 50 in 09e921f Then queries will go through Line 19 in 09e921f I think you can change the url to the query for getting a list of releases. Hopefully prereleases are in there and you can work from there. But yeah, you may need to add code to provide a token to the REST API or you may run into rate limiting issues. Right now we only use rest if you don't provide a token: autocopr/autocopr/latestver.py Lines 13 to 22 in 09e921f So if you need to do this, maybe add a Through GraphQLUltimately I think GraphQL is a better solution since it'll only fetch what you need, but it'll definitely take more development time to get the query you need. This is the query that takes a list of ids and gets the releases: Lines 118 to 131 in 09e921f This is the only time I've used GraphQL and I wrote this 2 years ago so I'm a bit rusty, but I know the Github GraphQL docs were very useful.
I think what you'd want to do is instead of If you're taking this route I'd highly suggest using an editor to test out your queries, I remember going through a lot of trial and error to get my final queries. I used Altair GraphQL Client, although that was 2 years ago so I don't know what the best client is now. But something that lets you quickly edit the query and see the results is very very useful!
I'm not familiar with this, what makes a template repo different from forking the repo? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I can't seem to really understand graphQL and such but I wish for the python script to be possible to add or change to a prerelease version as well. Are you able to help with that? Thanks! 🤗
Also, maybe you can set this repo as a template repo which people can fork from, perhaps?
Best regards and have a good weekend!
RelativeSure
Beta Was this translation helpful? Give feedback.
All reactions