-
Notifications
You must be signed in to change notification settings - Fork 149
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
feat: poc octo run list #638
base: master
Are you sure you want to change the base?
Conversation
Using graphql is not a big deal. Just use whatever endpoint that works. Think there are a few non graphql commands used. |
Ah okay, functionality wise, do you have any feedback? |
I will give it a try when I can! |
Think it looks good. Would you want to make use of the pickers instead of the new, custom buffer? I have been using telescope recently. What do you use? Some items:
|
|
You still want there to be a buffer when you press |
Thanks for the PR @GustavEikaas! I like the idea of showing the status of the run in the preview buffer and perhaps show the logs of the run upon opening the item with |
IIRC the sequential jobs is already supported but yes I was thinking the same. |
@pwntester |
Doesnt seem like there is a good structured output for workflow logs. Will probably be tricky to have the same UI as github web. |
Nice, perhaps we can do a nested telescope selection where the use first chooses the run and then the job, that should get us a shorter log to show to the user and it should easier to print since we dont need to care about job's dependencies, just sequential steps |
No worries. The experience doesn't have to be optimal. I just a working solution for finished logs would be fine. No need to aim for streaming. As you mentioned, looking at failed jobs is likely the most common usecase. Let's try to get this merged in and people can try. For me, it still doesn't allow me to open. I am getting that same traceback. What is your current bandwidth for this PR? |
If the goal is to prioritize looking at failed jobs I can probably finish the PR this week. Ill look closer into your issue after work. Looks like os.tmpname fails to generate a unique name for you. weird... |
I am on WSL. Not sure if that is related. I use tmp files for other programs no worries. |
@wd60622 After looking closer at the code im still thinking it fails to generate a unique tmpname which is pretty weird. I'm also using WSL but no issue for me.. Anyways I updated the code to handle the case of generating a unique tmpname. Would you mind testing again. Other than that I think the code is pretty much done, just a bunch of CR fixes remaining presumably. Feel free to review and comment the code |
I've just updated my branch and still not working :( I will have to investigate further. Same traceback as before. |
Hmm if youre getting exactly the same traceback as before I think it means the plugin isnt updated with the latest commit. Could you try removing it and installing it again from the same branch? Im pretty sure I have ran into the same issue with lazy before, Update doesnt always work |
This is my configuration. It should be using the latest version of your branch : |
Does it reference the same tmpname in the stacktrace every time? |
I was mistaken. This is a different traceback. Here are the results of three different attempts to open:
|
@wd60622 That is crazy, here is the code. Looks a lot to me like your tmp folder is filled with an insane amount of files or there is something wrong with os.tmpname implementation? I guess I could try a different approach than os.tmpname but are we sure this is not related to your setup/environment? local function create_unique_tmpname()
local depth = 50
local attempts = 0
local tmpname
while attempts < depth do
tmpname = os.tmpname()
local file = io.open(tmpname, "r")
if not file then
return tmpname
else
file:close()
end
attempts = attempts + 1
end
error("Failed to create a unique temporary file name after " .. depth .. " attempts.")
end
|
Yeah, weird. Thanks for sharing the snippet. Let me isolate it and see what happens |
The files are being created in the /tmp folder. I see them after running the function isolated. The file object looks like this: EDIT: I had some success with this: local function create_unique_tmpname(opts)
local depth = opts.depth or 50
local attempts = 0
local tmpname
while attempts < depth do
tmpname = os.tmpname()
local file = io.open(tmpname, "w")
if file then
file:close()
return tmpname
end
attempts = attempts + 1
end
error("Failed to create a unique temporary file name after " .. depth .. " attempts.")
end
local filename = create_unique_tmpname { depth = 2 }
|
hmm problem with your edited snippet is im preparing a new directory for unzip to unzip into. If I write to that file it will exist and thus cannot be overwritten. I need the function to generate a unique name for a file that does not yet exist. Whats weird however is how writing the file makes the problem go away for you. Strange... |
It seems to create the file on read. Is there an directory exists function that could be used instead? Maybe in plenary |
If i put this in my init.lua function in throws an error when i start neovim. This is because the file does not exist and thus the filehandle is nil. But the following code seems to behave different for you and create the file? local tmpname = os.tmpname()
local file = io.open(tmpname, "r")
file:close();
print(tmpname) I guess i could replace the code with, expecting success == false |
A lot of testing for you but maybe the latest one works? where i use vim.fn.readfile instead to check if file exists? |
Finally found it. Its a POSIX quirk. From the lua docs for os.tmpname In POSIX systems, this function also creates a file with that name, to avoid security risks. (Someone else might create the file with wrong permissions in the time between getting the name and creating the file.) You still have to open the file to use it and to remove it (even if you do not use it). |
Latest commit works fine on arch (btw), and windows. Should work just fine for you now @wd60622. |
Thanks for the updates. will give it a try when I can |
Important
This is a draft PR
Im making this draft PR so I can get reviews/suggestions during development
I will fill out the PR template when the PR is ready for review
Resolves: #149
Describe what this PR does / why we need it
First PR in a series of PRs to add support for github actions
Does this pull request fix one issue?
Describe how you did it
Describe how to verify it
Special notes for reviews
Checklist
Feature checklist
##[group]
[command]
Remaining
Look into using graphql in favor of gh cli commands (not sure if strictly necessary but conforms to the repo standard)