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
Add new workflow to automatically (and periodically) update ex_doc
version
#65
Conversation
@MarkoMin, I created an Elixir script your pull request could plug in to (if it gets merged first), so that a pull request also gets created alongside the issue. 👍 My pull request is mentioned above. And here's an example of an automated pull request: https://github.com/paulo-ferraz-oliveira/rebar3_checkshell/blob/main/.github/workflows/rebar3_depup.sh (I do prefer to have my shell script separate so I can "shellcheck" and "shfmt" it 😄). |
Oh, I didn't even think about that, that could work nicely! I'll utilize it if/when it gets merged. |
One thought: do we actually need both an issue and a PR? We should switch to PR only IMO. |
I thought about that, too. Maybe PR alone is enough. |
Seems like it should be. But now we wait for #67 to get merged |
@MarkoMin, #67's merged. It ended up being a Mix task. I think you'd need to compile it and run it, unless @starbelly has a different suggestion. |
ex_doc
version
A thought on this, and this may or may not be pragmatic, but we have both erlang and elixir at our disposal. We could write a bit of code that uses httpc to get this information and handle the result with more exactness (i.e., use verl or Version, Version if it's a mix task). Other thought, since we're wanting to get the latest release that is available on hex, we can just hit the hex api to get this info.
|
Good stuff. And |
Yeah. More like you can use erlang or elixir and httpc to do the gets and posts vs a bunch of shell scripterty, but that said. Let’s be pragmatic. |
I've made following changes:
|
I approved the workflows to run. I'm forking your branch to test out the flow... |
@starbelly, if this isn't done already we're gonna need to enable and also |
@MarkoMin, you copied to "lib/mix/tasks", instead of moving... |
Example of a pull request working: https://github.com/paulo-ferraz-oliveira/rebar3_ex_doc_mm/pull/2/files. |
@MarkoMin, sorry I did so many small changes/suggestions, but it was the best way I found to explain my reasoning. Accepting them all should put the pull request in a mergeable state. |
I think with how infrequent ex_doc releases are (and should be) we should just allow the bot to open PR. We definitely want to see what the bot has done before merging, thoughts? |
That's my goal. I was under the impression you needed:
But maybe the former is not required (?) |
We can also accept+merge (once all changes are done), then test the settings that are required (our goal is only to create the pull request, as automating stuff like this can lead to issues - let's say that |
I approved all suggestions. Sorry for errors with Now it should be done. It's quite messy with all those commits, but we can squash them I guess. For some reason, |
lib/mix/tasks/up_ex_doc_version.ex
Outdated
|
||
File.write!(@mix_exs, "#{content_up}\n") | ||
env = [{"PATH", System.get_env("PATH")}] | ||
System.cmd("mix", ["deps.unlock", "ex_doc"], env: env) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can do this and it should be fine, but probably more pragmatic is to run this, then execute mix deps.get
back in the shell (i.e., in whatever workflow that will use this).
Thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't mind doing it in another pull request @starbelly, even before we release. This fix is already scope creep caused by me, since it wasn't in the change proposed by @MarkoMin initially.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@MarkoMin, if you prefer to do it, you can remove these calls to mix from here and set them in the CI bit... But lemme know, otherwise I can also do in a subsequent pr (since this one's working as-is)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can do it. Do I need to remove File:write also or just lines 14 and 15?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
14-16, then add their equivalent to .yml
. 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
@MarkoMin, could you rebase this onto the main branch, and move the script? I see this in the Files' tab and it's confusing. Thanks. |
Also, query for getting issues is fixed because by default it retrieves only open issues.
Co-authored-by: Paulo F. Oliveira <paulo.ferraz.oliveira@gmail.com>
Co-authored-by: Paulo F. Oliveira <paulo.ferraz.oliveira@gmail.com>
Co-authored-by: Paulo F. Oliveira <paulo.ferraz.oliveira@gmail.com>
Co-authored-by: Paulo F. Oliveira <paulo.ferraz.oliveira@gmail.com>
Also, query for getting issues is fixed because by default it retrieves only open issues.
Co-authored-by: Paulo F. Oliveira <paulo.ferraz.oliveira@gmail.com>
Co-authored-by: Paulo F. Oliveira <paulo.ferraz.oliveira@gmail.com>
614a04f
to
757c84d
Compare
done |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! If it fails, we can fix it 😄
Tried everything locally (except actually creating an issue). If it works correctly, it will create one at midnight. First time having fun with GH actions so there may be some mistakes.
Closes #57