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

Julep: interlocked changes across the package ecosystem #770

Open
timholy opened this issue Sep 21, 2018 · 11 comments
Open

Julep: interlocked changes across the package ecosystem #770

timholy opened this issue Sep 21, 2018 · 11 comments

Comments

@timholy
Copy link
Member

timholy commented Sep 21, 2018

At quite a few points in my development experience I've made changes in one package that have ripple effects across many others. I remember one case involving colors and/or images where just the sequence of making a change in one package, waiting for tests to finish, merging and tagging, getting the tag merged to metadata (me "abusing" my METADATA merge privileges and doing it ASAP, without waiting for someone to review it), and then going on to the next package literally took an entire weekend doing little else, even though I already had local branches queued for all of the changes.

The latest (much smaller) version of this just happened with OrderedCollections/DataStructures, JuliaCollections/OrderedCollections.jl#10.

It would be lovely to have some way of easily expressing a transient dependency on not-yet-merged branches in other packages, without having any more customization than necessary that later needs to be backed out. My main suggestion for this would be to add a top-level file like PreferredBranch.toml with contents

ColorTypes = "teh/fix_283"
Colors = "teh/newct"
ImageCore = "teh/newct"
...

and list the specific branch that CI should check out in each package. This would have two impacts:

  • As the changes are being submitted package-by-package, the developer can copy the previous PreferredBranch.toml file to the next project, adding the relevant line about the right branch for the just-submitted PR in the previous package.
  • When it's time to merge and tag things, the developer somehow submits the final PreferredBranch.toml file to attobot, which does everything (merging the PRs and submitting the METADATA tags) all at once; after merging to METADATA attobot also submits and merges a PR to delete PreferredBranch.toml from each package.
@StefanKarpinski
Copy link
Member

This seems like it might be a case for a "development registry" where you can play around with versions until you get it right and everything works and then upstream the lot of them all at once. Would that work? One can also work on branches of a registry and tweak things until they're right. We can consider versions on branches not to be "written in stone" until they're merged into master.

Relatedly, I've been thinking about tooling to allow orgs to have their own registries where they can implement their own CI policies and include whatever upstream dependencies they "allow", pulling those from the General registry. Then people submit versions to the org registry for tagging and the org registry can implement whatever CI policies that they care to. Testing, coding, compatibility standards, etc. If an org registry is trusted, then General can just pull versions from the org registry automatically.

@timholy
Copy link
Member Author

timholy commented Sep 21, 2018

Yes, a development registry sounds like it would work well, and is better in the sense that it leverages existing infrastructure.

The org-specific registry also sounds pretty cool. A fair amount of work to configure initially, perhaps, but for a big org with lots of activity I can easily see it being worthwhile.

@Cody-G
Copy link

Cody-G commented Jan 8, 2019

I've only recently transitioned to Julia 0.7 so I may be unaware of some of the available development tools, but I've been finding it cumbersome to do CI with a development registry. Say that package A depends on package B, and B depends on C. If I've made a set of local changes to all 3 packages and want to push the changes and let Travis run tests, it seems I need to take this sequence of actions:

  1. Push update of C to Github, get Travis tests passing
  2. Push a commit to my development registry that updates Versions.toml for package C
  3. Push update of B to Github, get Travis tests passing
  4. Push a commit to my development registry that updates Versions.toml for package B
  5. Push update of A to Github, get Travis tests passing
  6. Push a commit to my development registry that updates Versions.toml for package A
  7. If desired make a PR to merge my development registry with its (non-development) counterpart

whereas before Pkg3 the sequence was simply

  1. Push update of C to Github, get Travis tests passing
  2. Push update of B to Github, get Travis tests passing
  3. Push update of A to Github, get Travis tests passing

Are there any tools to make this easier with Pkg3? Is my workflow in need of revision? Or is the thought that it's worth this extra development labor since it gives package users a more stable experience?

In cases like this I'm already feeling tempted to just combine A, B, and C into one package (when they're my own packages) to avoid this extra work. Usually I think of that as worse development practice, but I wonder if others are feeling the same temptation.

I'm hoping that someone will say "You're doing it wrong." rather than "Don't be lazy." :)

@StefanKarpinski
Copy link
Member

You should be able to check in a Manifest.toml file that uses non-registered versions of dependencies and it should just work. There's no requirement that versions in manifests are registered anywhere.

@Cody-G
Copy link

Cody-G commented Jan 9, 2019

You should be able to check in a Manifest.toml file that uses non-registered versions of dependencies and it should just work. There's no requirement that versions in manifests are registered anywhere.

I just want to make sure I understand: Are you suggesting that I check a Manifest.toml into each of the repos for packages A, B, and C in my example? I think I understand how that would allow me to develop freely without worrying about updating versions, but then when it's time to make my updated packages available to others through a registry I think I would need more commits removing Manifest.toml from each package? Or are you suggesting to avoid using a registry altogether? In our case that doesn't seem ideal.

@StefanKarpinski
Copy link
Member

StefanKarpinski commented Jan 9, 2019

There's no need to remove the Manifest.toml file when registering. It's ignored when your package is used as a dependency anyway. It only applies when your package is the primary application (e.g. when running tests). Committing a manifest file tracks a full set of dependencies that worked.

@Cody-G
Copy link

Cody-G commented Jan 11, 2019

It's ignored when your package is used as a dependency anyway. It only applies when your package is the primary application (e.g. when running tests).

Ah! I didn't understand this. Somewhere I read that Manifest.toml isn't/shouldn't be committed, and I assumed this was because it could cause conflicts with a registry. Thanks!

@timholy
Copy link
Member Author

timholy commented Feb 2, 2019

Committing the Manifest isn't working for me. I suspect the problem is due to my script section in the .travis.yml file:

script:
  - if [[ -a .git/shallow ]]; then git fetch --unshallow; fi
  - julia -e 'using Pkg, LibGit2;
              user_regs = joinpath(DEPOT_PATH[1],"registries");
              mkpath(user_regs);
              all_registries = Dict("General" => "https://github.com/JuliaRegistries/General.git",
                            "HolyLabRegistry" => "git@github.com:HolyLab/HolyLabRegistry.git");
              Base.shred!(LibGit2.CachedCredentials()) do creds
                for (reg, url) in all_registries
                  path = joinpath(user_regs, reg);
                  LibGit2.with(Pkg.GitTools.clone(url, path; header = "registry $reg from $(repr(url))", credentials = creds)) do repo end
                end
              end'
- julia -e 'using Pkg; Pkg.build(); Pkg.test("RegisterMismatch"; coverage=false)'

In the Travis build log, there's a section

...  # a bunch of public packages, finishing with...
 Installed Colors ──────────────────── v0.9.5
 Installed FFTW ────────────────────── v0.2.4
   Cloning [3bd9afcd-55df-531a-9b34-dc642dce7b95] RFFT from git@github.com:HolyLab/RFFT.jl.git
[ Info: Installed RFFT ────────────────────── v0.0.0
   Cloning [67712758-55e7-5c3c-8e85-dda1d7758434] RegisterCore from git@github.com:HolyLab/RegisterCore.jl.git
[ Info: Installed RegisterCore ────────────── v0.1.0
   Cloning [46a7138f-0d70-54e1-8ada-fb8296f91f24] CenterIndexedArrays from git@github.com:HolyLab/CenterIndexedArrays.jl.git
[ Info: Installed CenterIndexedArrays ─────── v0.1.0
   Cloning [abb2e897-52bf-5d28-a379-6ca321e3b878] RegisterMismatchCommon from git@github.com:HolyLab/RegisterMismatchCommon.jl.git
[ Info: Installed RegisterMismatchCommon ──── v0.1.0

Unfortunately it doesn't specify the git-tree-sha1 used for these packages. However, from the fact that it errors, I suspect it's ignoring the git-tree-sha1 in the Manifest.toml that I committed.

@KristofferC
Copy link
Member

I'll close this as a dup of #770 since they seem fairly similar.

@StefanKarpinski
Copy link
Member

This is very similar to #770.

@KristofferC
Copy link
Member

😢 I always do this

@DilumAluthge DilumAluthge reopened this Sep 21, 2022
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

No branches or pull requests

5 participants