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

Add support for allowing orgs from Github/Gitlab/Bitbucket #236

Closed
Jake-Shadle opened this issue Aug 5, 2020 · 0 comments · Fixed by #237
Closed

Add support for allowing orgs from Github/Gitlab/Bitbucket #236

Jake-Shadle opened this issue Aug 5, 2020 · 0 comments · Fixed by #237
Assignees
Labels
enhancement New feature or request

Comments

@Jake-Shadle
Copy link
Member

Generally, I think most projects in the Rust space probably follow a similar procedure as we do when they want to fix a bug or add a feature to one of their dependencies, which is basically.

  1. Fork the crate to your/your company's "organization" (organization in Github terminology, might be different for other providers)
  2. Hack away locally, probably just patching your project(s) to use a path dependency to the cloned fork
  3. Push changes to your fork, and once you're happy, change the path dependency to a git dependency and point it to your fork for others/CI to be able to use the same changes easily
  4. Eventually (hopefully!) make a PR to the original repo with your changes
  5. Hopefully get your changes merged to the original repo
  6. Wait until a release is made that incorporates your changes, possibly changing the git source to point to the original repo
  7. Remove the git source and instead point at the new version of the crate with your changes
  8. Profit!

This process is generally great, but because of the sources check, it gets kind of tedious, for example, here is what our largest project looks like right now.

allow-git = [
    "https://github.com/EmbarkStudios/cpal",
    "https://github.com/EmbarkStudios/winit",
    "https://github.com/EmbarkStudios/sentry-rust",
    "https://github.com/EmbarkStudios/lmdb-rs",
    "https://github.com/EmbarkStudios/juniper",
    "https://github.com/EmbarkStudios/rust-postgres",
    "https://github.com/EmbarkStudios/vk-mem-rs",
]

That's way too many duplicated characters!

Instead, we should just have something like

[sources.allow-org]
github = [
    "EmbarkStudios",
]

It seems like Gitlab and Bitbucket would also work with this, so those could be added as well, any other providers that followed the same <domain>/<org>/... scheme could be added in the future.

@Jake-Shadle Jake-Shadle added the enhancement New feature or request label Aug 5, 2020
@Jake-Shadle Jake-Shadle self-assigned this Aug 5, 2020
Jake-Shadle added a commit that referenced this issue Aug 6, 2020
* Add UnvalidatedConfig trait

* Add feature to allow github/gitlab/bitbucket orgs instead of only exact urls

Resolves: #236

* Refactor and simplify tests

* Add sources tests

* Add gitlab/bitbucket tests

* Add suppport for checking all git sources have the required minimum spec

Resolves: #235

* Update sources doc

* Update CHANGELOG
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant