-
Notifications
You must be signed in to change notification settings - Fork 1.7k
chore(dev): RFC for a tooling revamp #15056
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
Conversation
ofek
commented
Nov 1, 2022
•
edited
Loading
edited
- rendered
- PoC
✅ Deploy Preview for vector-project canceled.
|
❌ Deploy Preview for vrl-playground failed.
|
I think it would be valuable to determine why we've decided to write this in Rust vs another language (likely Python). My surface level review would lead me to believe having it in Python would be easier for onboarding and ux as you wouldn't need to go through compiling it (and possibly getting deps to compile) before usage. On the other hand, it would be difficult to develop against Vector without having the tools and know-how to compile |
I added a note 👍 |
Co-authored-by: neuronull <[email protected]>
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.
Overall, I really like this RFC in spirit.
I do see a very large practical problem with achieving the intended outcome, vis-á-vis only running tests that are "affected" by the PR, if we need to manually list out what changes should trigger the tests.
I'd personally still like to see this tooling even if it has to be invoked manually, and so I think it could be worth fleshing out/expanding what it would look like to use this to drive the two most common workflows: run all integration tests, and run a specific integration test. Essentially, use those two examples as part of the RFC and show more specific examples of invocation.
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.
Generally like the direction here. In hindsight, I think this should have been two RFCs: one for the devtool, one for the integration test refactor, to focus the discussions around each aspect (granted the integration test refactor would depend on the devtool).
My biggest question is around developer productivity of having the tool be in Rust. I'm curious to get other team members' opinions here though.
### Python | ||
|
||
- Could call environments' `start`/`stop` methods through Hatch to avoid maintaining matrix logic | ||
- Could write all tooling in Python to theoretically increase development velocity |
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'm definitely 👍 on the dedicated CLI, but I did have some concern about using Rust for it since I was concerned that might decrease developer productivity when working within the CLI, which has less of a concern on correctness and does a lot of subprocess execution. It sounds like you've found it plenty productive though, given your experience working on a similar tool in Python? It does have the advantage that everyone on the team is experienced in Rust.
As another data point, @tobz how would you have felt writing https://github.com/vectordotdev/vector/blob/master/scripts/generate-components-docs.rb in Rust vs. Ruby?
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 also thought of this yesterday - if this is to power CI, how/when would it be built for CI?
If we need to compiler during the the CI run that adds time (hopefully not much because the code should be small...) or built only on changes to the tool and pull from those artifacts.
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.
As another data point, @tobz how would you have felt writing
generate-components-docs.rb
in Rust vs. Ruby?
At the time, it probably would have sucked more to slog through writing it in Rust from scratch. Doing that now... probably wouldn't be terrible because it'd be easy to know when I reached feature parity by comparing the outputs directly, and having a good mental model of how it's structured.
🤷🏻
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 biggest question here is around the scope of the vdev
tool and whether it's worthwhile to build something custom. There are a lot of options in between make
(which I agree is quite awful) and writing something totally custom. Some examples I'm aware of are just
and the cargo xtask
pattern. Was anything like one of those considered?
For the integration tests specifically I can see a stronger argument for writing some tooling from scratch, but still it seems like the scope should be minimized.
On the Python question, I would strong prefer Rust over any language that:
- Not everyone on the team has experience with
- Brings in all kinds of additional setup issues like virtualenvs, etc
Yes just is basically the same as now but with Windows support and xtasks are in Rust like the dedicated tool but with added complexity of Cargo and lots of boilerplate |
I guess I should clarify that my comments are primarily about the
This might just be showing my lack of imagination for what types of things
I understand it's just a proof of concept at this stage, but I can really only see the value in the integration test tooling. If we're going to build the rest of it, we should have some clearer justification of why it's more valuable than just using a better command runner and/or migrating scripts away from bash.
I'm not entirely sure what you mean by the "complexity" of Cargo, but the integration with Cargo is one of the main benefits of the pattern: you don't need to build and distribute a separate tool. Otherwise it seems largely similar to what you're doing with Overall I do feel like I'm missing something here, so apologies if that's the case. A little bit more about how the tooling presented here is meant to address each item in the "Pain" section would probably help ensure we're all on the same page. Some of them are obvious (e.g. Windows support), but with others (e.g. test failures are hard to debug) it's a little less obvious. |
This would require having Cargo and a compiler on every runner rather than fetching a single binary.
That way requires modification of Vector's workspace + a special directory structure and config file. Maybe we're reading different docs? |
A lot of those example are cool and interesting things, but aren't quite at a level of solving the concrete pain points in this RFC. I'm certainly not against having them, but I don't think they alone are enough to justify writing a new tool right now.
This is an important point I think. Is it a requirement to run these tools/tasks somewhere without a Rust toolchain? My assumption has been that it will be used in place where you're already assumed to be able to compile Vector itself.
We're already using a workspace, so it's ~3 lines of config and then writing a new crate just like vdev: #15191 To move this forward, I think I would recommend focusing for now on the concrete problems of (1) integration tests, and (2) Windows support. That would involve setting up either something independent like |
To be clear, what is your proposal? Also, are you aware that everything you asked for regarding testing is already implemented? |
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 know there is still discussion ongoing, and others on the team have more experience/history to weigh in with than me.
But the questions I had were answered so I'll drop in my approval (for what that's worth 😃 ).
As I mentioned in standup I think overall the pros outweigh the cons wrt to selecting Rust for the language.
Related to Luke's concern, and after reading some of the documentation for It essentially has you create a crate that builds into a binary, and takes positional arguments, and so on. To me, this means that porting Given that we don't currently use As far as Ofek's comments around being able to distribute a single binary: for local Vector development, pulling a single binary does feel slightly moot since you're already expecting to be able to compile Vector, so you'll have the toolchain to build However, given that |
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'm a semi-firm "yes" on this.
I think, like many things, there's too many possible uses of this tool to properly categorize them all up front and figure out if this approach is the absolute best approach, and so on... but I agree with the approach insofar as it will certainly unify our fragmented ecosystem of scripts and commands used in local development and CI, and provide a more familiar base (Rust) to build further tooling on top of.
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.
Similarly soft-✅, it seems like a good step forward even if we change the actual implementation down the line the actual meat of the tool should be reusable.
@ofek is there anything else you want to do with this or can we merge it? |
Merge away! |
|
||
### Implementation | ||
|
||
The [integration test directory](https://github.com/vectordotdev/vector/tree/v0.24.2/scripts/integration) will become nested, with each integration having its own directory, which will be a Rust crate. |
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.
Noting a late comment on this for posterity.
While I do think the overall tool idea could be a benefit to Vector development, I'm not a big fan of this particular mechanism for integration tests. I would anticipate a lot of shared code between these tests, leading to these crates being bogged down with a lot of boilerplate, as evidenced by the follow-up PRs to implement them.
Note that having one directory per integration test is likely a win to collect all configuration together, my objection is to the duplication and opportunities for one-off errors that this would induce.
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.
Shared test utilities already noted in https://github.com/ofek/vector/blob/tooling-rfc/rfcs/2022-10-31-15056-tooling-revamp.md#future-improvements