-
Notifications
You must be signed in to change notification settings - Fork 7
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
doc: initial flow #1
Conversation
README.md
Outdated
|
||
1. Define the list of dependents you want to test against in a `wiby.json`. | ||
1. Push the release candidate branch or tag to GitHub. | ||
1. Indicate that you want to start your dependent tests by running `wiby test` locally while on your release candidate branch. |
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.
the list of dependents seems like it should be in the local working copy too?
README.md
Outdated
1. Indicate that you want to start your dependent tests by running `wiby test` locally while on your release candidate branch. | ||
1. `wiby` will look for your defined list of dependents to test against in `wiby.json`. | ||
1. For each module in the `wiby.json`, retrieve their `package.json` and determine whether the module is likely to automatically be updated to the new version of your module once it is released. | ||
- For example, if you're creating a release candidate for `v2.1.0-rc`, and the dependent module is using the range `^1.x.x`, then we should not open a test PR. |
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.
There’s really two situations you want to test tho - one is “I’m trying not to break you with this non major bump” and the other is “I’m making a semver-major but i want to know who it breaks and how”
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.
Ah, we did not have major releases in mind. Maybe there should be a --major
option? Or --force
that would not do the 'Will you be automatically updated to this version?' check. But maybe that should be the default 🤔
The motivation behind this was to try and minimize the influx of draft PRs (especially if the dependent is unlikely to pickup the new release candidate version).
Another approach could be to allow maintainers to be able to opt-in to either/both applicable range and major updates in the wiby.json
(final name/format TBD). Then external dependent maintainers can PR their module and indicate whether they want to be tested against majors in the wiby.json
file.
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 think my idea below might help. If the tool forks the repo to your personal account before opening the PR it will reduce the noise. This also allows you to be more flexible for when you run it, because I imagine that I would want to run this before ever pushing, especially if it was just an idea to test out.
README.md
Outdated
# Flow | ||
|
||
1. Define the list of dependents you want to test against in a `wiby.json`. | ||
1. Push the release candidate branch or tag to GitHub. |
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 know if this is intentionally excluding other workflows but it seems to me that some project might see this more as a nightly job. We should just make sure the solution will run well as an action on commit or a cron.
README.md
Outdated
1. Push the release candidate branch or tag to GitHub. | ||
1. Indicate that you want to start your dependent tests by running `wiby test` locally while on your release candidate branch. | ||
1. `wiby` will look for your defined list of dependents to test against in `wiby.json`. | ||
1. For each module in the `wiby.json`, retrieve their `package.json` and determine whether the module is likely to automatically be updated to the new version of your module once it is released. |
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.
This is a great addition! I do think there are cases where you want to test even if it is not auto updated. For example, express locks many of it's deps. I imagine ensuring you dont break express when it is time for them to updates will be important.
README.md
Outdated
1. `wiby` will look for your defined list of dependents to test against in `wiby.json`. | ||
1. For each module in the `wiby.json`, retrieve their `package.json` and determine whether the module is likely to automatically be updated to the new version of your module once it is released. | ||
- For example, if you're creating a release candidate for `v2.1.0-rc`, and the dependent module is using the range `^1.x.x`, then we should not open a test PR. | ||
1. Patch the `package.json` of the dependent module to point to the release candidate branch for your module. |
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.
This will need to be a bit more complicated than just that. It should probably use something like https://www.npmjs.com/package/preferred-pm to detect which package manager then run npm update
or yarn upgrade
, etc.
README.md
Outdated
1. For each module in the `wiby.json`, retrieve their `package.json` and determine whether the module is likely to automatically be updated to the new version of your module once it is released. | ||
- For example, if you're creating a release candidate for `v2.1.0-rc`, and the dependent module is using the range `^1.x.x`, then we should not open a test PR. | ||
1. Patch the `package.json` of the dependent module to point to the release candidate branch for your module. | ||
1. Open a draft PR in the dependents repository that contains the patched `package.json`. |
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 think it should fork the repo and open a PR there. If you do it against the actual repo it clutters it up, and also might result in notifications to maintainers.
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.
Yeah using forks for testing makes sense to me to avoid noise. My concern would be whether it is easy to automate the whole flow using forks? I'm sure the 'fork repository' part would be reasonable to implement. But, would it involve enabling some CI related WebHooks or settings on the forked repository? What if the module is using credentials in their Travis or Actions set up, would we need to manually define those?
Another thought - if there are CI allowances (minutes, runs), using forks moves the cost to the person or organisation running the tool. I think I agree that the person running the tool should bear the resource cost of the testing.
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.
Indeed; the newly created fork would need to be hooked up to CI. that's why greenkeeper et al all use branches on the source repo.
You're also absolutely right that this means the maintainer bears the cost / threshold usage; if there were an easy way for the initiator to bear it that'd be ideal.
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.
(just documenting roughly what I said during the last meeting)
I think the tool that runs the tests should mostly not care whether it's opening the PRs against a fork or against the original repo. It should have an option to update the repo's master if it's a fork, though. That's probably the first thing to check/do in the flow.
I think it's useful to also have a subcommand in the tool which allows creating the forks - the subcommand should be smart enough to call the relevant APIs to enable Travis/Github Actions (whatever else it wants to support) on the fork. But I don't think that's necessary to get started with this.
I think that the etiquette should be that you either have an explicit permission from the original author to open the PRs in their repo or you have to use a fork. I think larger organizations could have a full separate organization, with just the forks, used purely for testing to reduce noise. That could be a separate tool altogether (which is I wouldn't rush to build the forking support into wiby).
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.
Does GitHub disable actions on forks by default? I know for travis that is a tough problem. So I do see the problem here, but if I am consistently getting opened PRs on a popular project from this tool across all my dependencies, I am going to get quite annoyed with them. Distributing that across the entire ecosystem will be near on impossible for everyone to get permission and not annoy people. This I think will be the biggest sticking point for this project.
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.
The config for the jobs is there, so there must be an API to enable these jobs? Forking and releasing from a fork is a fact of life, so testing must be possible?
README.md
Outdated
@@ -17,4 +17,19 @@ | |||
1. Open a draft PR in the dependents repository that contains the patched `package.json`. | |||
1. `wiby` will create a JSON file (`wiby-v2.1.0.json`) which contains the links of dependent PRs that have been opened. |
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.
Why do we need the version in the filename?
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.
Ah, looking back this is unclear. I was thinking that the commit/branch/tag that we run against should be injected into the filename. But, that information could be stored within the file itself.
README.md
Outdated
1. For each module in the `wiby.json`, retrieve their `package.json` and determine whether the module is likely to automatically be updated to the new version of your module once it is released. | ||
- For example, if you're creating a release candidate for `v2.1.0-rc`, and the dependent module is using the range `^1.x.x`, then we should not open a test PR. | ||
1. Patch the `package.json` of the dependent module to point to the release candidate branch for your module. | ||
1. Open a draft PR in the dependents repository that contains the patched `package.json`. |
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.
(just documenting roughly what I said during the last meeting)
I think the tool that runs the tests should mostly not care whether it's opening the PRs against a fork or against the original repo. It should have an option to update the repo's master if it's a fork, though. That's probably the first thing to check/do in the flow.
I think it's useful to also have a subcommand in the tool which allows creating the forks - the subcommand should be smart enough to call the relevant APIs to enable Travis/Github Actions (whatever else it wants to support) on the fork. But I don't think that's necessary to get started with this.
I think that the etiquette should be that you either have an explicit permission from the original author to open the PRs in their repo or you have to use a fork. I think larger organizations could have a full separate organization, with just the forks, used purely for testing to reduce noise. That could be a separate tool altogether (which is I wouldn't rush to build the forking support into wiby).
README.md
Outdated
```json | ||
{ | ||
"express": "all", |
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.
Would it make sense to structure this as an array of objects, so that it's easier to extend in the future? e.g.
{
"dependents": [
{
"name": "express",
"repo": "git+https://....",
"triggers": ["all"],
"setting1": "value1"
},
{
"name": "express-session",
"repo": "git+https://....",
"triggers": ["rc"],
"setting2": "value2"
}
],
"config": {
"global-setting": "value3"
}
}
Maybe triggers
is not even necessary for the initial release? If this starts out as a CLI tool, then it's always an explicit call? e.g. $ cd my-repo && git checkout my-new-feature && wiby test
and then after some time $ wiby results
, which would loop through the PRs it can find and use the status API to report back?
Having a CLI tool means that it's easy enough to build a bot or a GH action or even Jenkins job (for those of us who are stuck in the past decades...), really. Both commands should be able to return results as json so that this can be used as a library too.
It should probably also include some fields from https://github.com/nodejs/citgm/blob/master/lib/lookup.json?
Here's a few other things to consider:
|
Depends on how the tool is used, I would say. If we're starting with the CLI, it may as well just rely on the presence of Not sure the tool needs to generate any tokens, though?
Yeah, I would say the PRs are unlikely to get merged, because they modify the
I would guess so. I think
I think auto-execution might be too much and would generate way too much noise. Think about how people are annoyed about dependabot - which opens PRs for real releases. And wiby would do that for things that aren't even released yet.
In the CLI initially, and in a PR comment going forward, similar to how coveralls does it? wiby could be smart enough to leave a marker inside the comment and keep updating that comment with its own metadata and latest results. |
Just occurred to me that this doesn't need a |
So i've tried to update the flow slightly, but it's not complete! In parallel, we're currently (@andrewhughes101 and I) working on implementing the first prototype to handle the simplest cases - pretty much Thanks for the input @dominykas (and others). I have read all the comments but haven't had time to think enough about some of them.
Need to think about the flow of this case a bit more.
Base branch of the dependent? I think we can add this to your suggested |
Does it make sense to land this as-is and iterate? I don't think it'll be possible to capture the agreed end-to-end flow in just one PR. I think it'd be nice to have a descriptive README sooner, and we can continue to edit it as the tool evolves? |
I'm very much in favor of landing this info, but I'm not sure we should land it inside the README. I feel that the README should reflect the current state of the tool - so maybe we should move this into a docs/rfc folder? |
I don't love the idea of having a I'm happy to move it to another file either way - and if you think |
I'm not set on that idea - just figured it might be a path forward. We can always split that out into a separate repo when we need that? But a separate file works too, I suppose. |
I've just moved it to |
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, since it tagged as Draft flow seems reasonable, and we can adjust as we get move experience as the tool is built.
@BethGriggs can you resolve the conflicts ? |
@mhdawson, resolved |
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.
My comments on the fork stuff still stand, but I think we can iterate on this as we start using it and see how it goes. Sorry for being a delay here!
🎉 This PR is included in version 0.1.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Before getting started writing the tool, we should define the expected flow of operation. @andrewhughes101 and I discussed this and tried to write down the end-to-end flow.
I have PR'd this to the README so that we can get line-by-line comments. All file names and formats are up for discussion.
Open questions from our discussion
wiby results
be presented?ping @dominykas @wesleytodd