Skip to content
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

New main update version and sources module. #1027

Merged
merged 10 commits into from Jun 18, 2020

Conversation

viniciusdc
Copy link
Contributor

@viniciusdc viniciusdc commented Jun 1, 2020

As mentioned by @CJ-Wright and @beckermr this new PR aims some alterations on the original version of
update_upstream_versions code to generate a JSON file containing the required new versions outside the graph structure. Is also, now communicates with the others functions of that module.

Now, I've created a separate module for the upstream sources in the library. A test in a separate repo using Circle CI, was made with an good result (The code runs) Circle Ci.
There are still some missing alterations as:

  1. Some sources still do some alterations directly to the graph structure;
  2. As cited by CJ, I still need to implement it on the cli.xsh file to be read (and execute).
  3. There is a missing feature, saliented by CJ that I (unfortunately) still could not set:

"Changes to make graph (or maybe the version bump code) to look at the source of new version numbers. (I think this is the main piece missing from this PR)"

So these are the next steps. (I would also like to apology myself for the late PR).

@codecov
Copy link

codecov bot commented Jun 1, 2020

Codecov Report

Merging #1027 into master will decrease coverage by 4.94%.
The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1027      +/-   ##
==========================================
- Coverage   62.95%   58.00%   -4.95%     
==========================================
  Files          51       53       +2     
  Lines        4603     5025     +422     
==========================================
+ Hits         2898     2915      +17     
- Misses       1705     2110     +405     
Impacted Files Coverage Δ
conda_forge_tick/new_update_versions.py 0.00% <0.00%> (ø)
conda_forge_tick/update_sources.py 0.00% <0.00%> (ø)
conda_forge_tick/all_feedstocks.py 20.33% <0.00%> (-4.11%) ⬇️
conda_forge_tick/make_graph.py 45.45% <0.00%> (-1.15%) ⬇️
conda_forge_tick/migrators/disabled/legacy.py 68.82% <0.00%> (-0.85%) ⬇️
tests/test_migrators.py 93.88% <0.00%> (-0.04%) ⬇️
tests/test_audit.py 100.00% <0.00%> (ø)
tests/test_use_pip.py 100.00% <0.00%> (ø)
tests/test_patch_dict.py 100.00% <0.00%> (ø)
conda_forge_tick/utils.py 62.16% <0.00%> (ø)
... and 27 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e34cec4...8892b40. Read the comment docs.

@CJ-Wright
Copy link
Member

We could push 3 into make_graph itself, having it draw from the new versions file and inserting them into the nodes. This would allow us to make the least changes to the rest of the code.

@viniciusdc
Copy link
Contributor Author

We could push 3 into make_graph itself, having it draw from the new versions file and inserting them into the nodes. This would allow us to make the least changes to the rest of the code.

Yes, thanks for the advice. I'm right now looking into make-graph script and function. I will look camly to it, cause there are so many things running inside it.

@viniciusdc
Copy link
Contributor Author

By the way, what means these tests of Travis and codecov ?

@viniciusdc
Copy link
Contributor Author

We could push 3 into make_graph itself, having it draw from the new versions file and inserting them into the nodes. This would allow us to make the least changes to the rest of the code.

Hi again, I am not sure about one thing, when the bot is running it first executes the make_graph phase and them runs the update upstream versions phase, right ? So, if we add the versions from the output file inside the graph nodes, it will be not so updated right ?

@viniciusdc
Copy link
Contributor Author

I'm testing the new additions, but I want to know if there is a way to save the output file created using the Circleci run ?

@viniciusdc
Copy link
Contributor Author

viniciusdc commented Jun 9, 2020

I discovered how, but it's really troublesome work with the SSH keys. So I will not be able to test the make_graph function. I Am creating a new PR with the updates. (and closing this one)... (as soon as the test with the new JSON output at Circle finishess)


logger.info("writing out file")
with open("new_version.json", "w") as outfile:
json.dump(to_update, outfile)
Copy link
Contributor

Choose a reason for hiding this comment

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

We should dump one file per feedstock.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is there a specific path we should use for them ? (like bump on it's Node path)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Can I create a file on cf-graph-countyfair to save these files according to node ?(cf-graph-countyfair/versions/{node}_new_version.json)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

if so, how can I send this file to that repo ?

Copy link
Member

Choose a reason for hiding this comment

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

You can make a folder using os.makedirs(foldername, exist_ok=True). The files should just be named {node}.json since the folder name should be descriptive that they are version numbers.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oh I see, them as we already have a Job on circle that saves all the alterations made during the running, them it will push the alterations automatically right ? If that's so I will made the corrections right away thanks 👍

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done, could someone check if it's ok ?

@viniciusdc
Copy link
Contributor Author

I will change the new version file (outputs) and them close this PR. Them create a new one using the correct name as update_upstream_versions and together with make_graph.

@CJ-Wright
Copy link
Member

I thought the updates to make_graph were going to go in an independent PR?

@viniciusdc
Copy link
Contributor Author

I thought the updates to make_graph were going to go in an independent PR?

Sorry my bad, I will update this with the new name and removing the current update_upstream_versions. And them open a new PR with make_graph. But for that I just need to know how to save the output file (from circle) to cf-graph-county fair (cause I need to open it using the make_graph).

@CJ-Wright
Copy link
Member

I would not remove update_upstream_versions in this PR.

In my opinion the ordering of changes should be:

  1. Merge this PR with the new setup
  2. Start the new setup on circle so that we actually populate the folder without disrupting current operations.
  3. Once we're happy with the way the code is working make the API changes (changing make_graph to use the new folder's info and renaming the new update file to update_upstream_versions and removing the old one.

This ordering makes certain that we have a minimal amount of time where the system might not work and gives us multiple points to turn back or fix things without disrupting the bot. API changes usually bring all sorts of issues with them, even when we've reviewed the code a lot, so we try to keep API breaking PRs small. Ideally an API break PR only has the API break, no other pieces of code.

The deploy function makes certain that everything is properly added to git, committed and pushed. You will most likely need to add the folder with the new versions to that, which should go in this PR.

@viniciusdc
Copy link
Contributor Author

Ok, thank you very much for the help. I will change the current way the files are being saved as stated by Matthew, and then merge. After that I will work into the circle job.

@viniciusdc
Copy link
Contributor Author

Is that okay for me to create the new versions folder at cf-graph-countyfair ?

@beckermr
Copy link
Contributor

Is that okay for me to create the new versions folder at cf-graph-countyfair ?

Yup!

A few things though

  1. Never force push to this repo.
  2. Never destroy files in it.
  3. If you are unsure, ask.

This repo holds all of the core data that runs the bot, so we have to be careful!

@CJ-Wright
Copy link
Member

I would rather that we use os.makedirs so we are certain the folder will exist, even in the event that it is deleted.

@viniciusdc
Copy link
Contributor Author

I would rather that we use os.makedirs so we are certain the folder will exist, even in the event that it is deleted.

Thanks, I was going to use a os.path.isfile to check that. Good to know 👍

@viniciusdc
Copy link
Contributor Author

viniciusdc commented Jun 12, 2020

Is that okay for me to create the new versions folder at cf-graph-countyfair ?

Yup!

A few things though

  1. Never force push to this repo.
  2. Never destroy files in it.
  3. If you are unsure, ask.

This repo holds all of the core data that runs the bot, so we have to be careful!

Thanks for the advice. I've completed the changes and will commit them as soon as possible.
(The circle jobs that I can edit (or create) are at circle_workers or here ?)

@beckermr
Copy link
Contributor

Those jobs are in the circle_worker repo

@viniciusdc
Copy link
Contributor Author

Those jobs are in the circle_worker repo

Thanks, if the new dump structure is ok, I will work at this ^

@viniciusdc viniciusdc closed this Jun 12, 2020
@viniciusdc
Copy link
Contributor Author

viniciusdc commented Jun 12, 2020

I've added the changes to cli.xsh as mentioned. For circle_worker this will come at another PR 61.

@viniciusdc
Copy link
Contributor Author

May I merge this one ?

@CJ-Wright
Copy link
Member

Please don't merge your own PRs (it is a bit of an anti-pattern)

@viniciusdc
Copy link
Contributor Author

Ok sorry about that. Thanks for the advice 👍

@viniciusdc
Copy link
Contributor Author

Is there something I need to change for the merge ? Is there any other thing I can do ?

@CJ-Wright
Copy link
Member

CJ-Wright commented Jun 15, 2020

Sorry for the review delay. Yes, if you are blocked on one PR/part of your project please feel free to start working on the next part. (assuming one doesn't depend on the other)

@viniciusdc
Copy link
Contributor Author

Sorry for the review delay. Yes, if you are blocked on one PR/part of your project please feel free to start working on the next part. (assuming one doesn't depend on the other)

Actually I do need this running at circle to work on the make_graph PR, right ? So if there is any other part, that I maybe missing please inform me, and I will work into this 👍

@viniciusdc
Copy link
Contributor Author

Then I will work on the pool version of the update_versions.

@viniciusdc
Copy link
Contributor Author

@CJ-Wright I saw your [#1032], can I implement these name changes here too ?

@CJ-Wright
Copy link
Member

If you want to do it on the new code you wrote, sure. Please don't change the code you haven't already changed though.

@viniciusdc
Copy link
Contributor Author

If you want to do it on the new code you wrote, sure. Please don't change the code you haven't already changed though.

Yup, thanks.

@CJ-Wright
Copy link
Member

this needs black run on it.

@ocefpaf
Copy link
Member

ocefpaf commented Jun 17, 2020

this needs black run on it.

@CJ-Wright are you opened to add a pre-commit hook here?

@marcelotrevisani
Copy link
Member

this needs black run on it.

@CJ-Wright are you opened to add a pre-commit hook here?

grayskull is already using it, if you want to you can copy from there or get that as example
https://github.com/marcelotrevisani/grayskull/blob/master/.pre-commit-config.yaml

@viniciusdc
Copy link
Contributor Author

viniciusdc commented Jun 17, 2020

Sorry IDK what is a pre-commit in your sense of speaking, can someone clarify this to me ?

@viniciusdc
Copy link
Contributor Author

viniciusdc commented Jun 17, 2020

Then I will work on the pool version of the update_versions.

I've just finished the pool version here, I will test here and them commit the changes. (one question can I put the two of them here as update...version sequential and update...version pool ?)

@viniciusdc
Copy link
Contributor Author

There was any change with Travis ? Cause now Travis build passed successfully !

@marcelotrevisani
Copy link
Member

marcelotrevisani commented Jun 17, 2020

Sorry IDK what is a pre-commit in your sense of speaking, can someone clarify this to me ?

Sorry, I should be more clear
pre-commit is a tool which leverages the git hooks to run linters, or some tools to improve code quality before you commit code

You can find more information about this tool here:
https://pre-commit.com/
https://github.com/pre-commit/pre-commit

@viniciusdc
Copy link
Contributor Author

Sorry IDK what is a pre-commit in your sense of speaking, can someone clarify this to me ?

Sorry, I should be more clear
pre-commit is a tool which leverages the git hooks to run linters, or some tools to improve code quality before you commit code

You can find more information about this tool here:
https://pre-commit.com/
https://github.com/pre-commit/pre-commit

Thank you ! 🙂

@CJ-Wright
Copy link
Member

LGTM

@CJ-Wright CJ-Wright merged commit a1e09a1 into regro:master Jun 18, 2020
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.

None yet

5 participants