faker
faker copied to clipboard
Proposal: GitHub workflow to comment example set on PR
Clear and concise description of the problem
As a reviewer, I like to check how a change in the code base changes the generated values from the faker library (especially when locales change). Currently, I have to manually check out the feature branch (or use github.dev) and create a test file where I call the functions that have changed to log the generated values.
Suggested solution
Implement a workflow that comments on a Pull Request when it is opened. The comment will include a set of example values of each faker function.
This will be a massive QOL change for reviewers to check for believability in the generated values.
Alternative
No response
Additional context
No response
I like the idea, but I'm not sure whether this is feasible. If its impacts the docs, then I could think of a way to detect at there is a difference, but implementation or dependent locale changes might be hard. (Unless they show up in the seeded tests).
I'm not sure how to implement this as well. Just want to leave this here so we can potentially discuss this. Or someone magically wants to provide a solution to this.
I'm working on it.
Would this be an opt-in, like make a comment in a PR something like a discord bot. Example:
# this would comment on the PR with a random return value of any function in the address module
.comment-sample address
# this would comment on the PR with a random return value of faker.address.street
.comment-sample address.street
# this would comment on the PR with a random return value of any function in the address and internet module
.comment-sample address,internet
Or should it be an automatic thing that just triggers one on create? Or any time the PR is updated?
IMO it should only all methods in a module or a specific module. It would be nice if this would always create a post and update it later on.
The update part might be possible, but I never worked with GitHub actions so I'm not sure what I'm doing. I will go the easy way for now and post a new comment for the first iteration of the prototype.^^ But I like the idea and will research on how that would be possible.
This got resolved with the implementation of our snapshot tests.