-
Notifications
You must be signed in to change notification settings - Fork 25
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
kernel: Declare a useless function #203
Conversation
Signed-off-by: Anas Nashif <[email protected]>
Add a poorly declared thread function for demo purposes. Signed-off-by: Abe Levkoy <[email protected]>
This is a proof-of-concept PR to try out using fixup commits during reviews and autosquash at the end of the review. Context: zephyrproject-rtos/zephyr#52731 People may review this, and I'll make changes in the form of pushing fixup commits. Once people like the whole thing, I'll autosquash and push again. Hopefully, it will be obvious to the reviewers that I didn't change anything else, but it will have been easier for them to review intermediate changes than it would be if I updated a whole stack of commits and force pushed. |
Adding another commit to make the squash a little more interesting.
include/zephyr/kernel.h
Outdated
@@ -5832,6 +5832,14 @@ int k_thread_runtime_stats_get(k_tid_t thread, | |||
*/ | |||
int k_thread_runtime_stats_all_get(k_thread_runtime_stats_t *stats); | |||
|
|||
/** |
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.
Please fix the trailing white space.
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.
Fixed in 86c2994.
include/zephyr/kernel.h
Outdated
* @param thread ID of thread | ||
* @return 0 on success, negative error code on failure | ||
*/ | ||
void z_describe_thread(k_tid_t thread, const char *description); |
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.
How about creating a symmetrical API. z_thread_set_friendly_name
and z_thread_get_friendly_name
.
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.
Fixed in fixup commits.
@galak Some time ago, the process improvement WG discussed creating a test PR to try out autosquash during code reviews. IDK if you want to personally give this a try, but can you add someone who might be interested to this review? |
kernel/thread.c
Outdated
|
||
void z_describe_thread(k_tid_t thread, const char *description) | ||
{ | ||
int description_size = 1000; /* Max size of a description */ |
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.
(dummy review) description_size
could be 128.
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.
Fixed in 46c6b6a.
Fix formatting, add a getter API Signed-off-by: Abe Levkoy <[email protected]>
Adjust buffer size, fix formatting, add getter API This commit message is now wrong and will need to be updated as well. Signed-off-by: Abe Levkoy <[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.
Responded to review comments in fixup commits, i.e. commits that will be squashed with previous commits before merging.
I started out using git commit --fixup
in anticipation of using git rebase --autosquash
later. This would have produced commit messages of the form fixup! <previous headline>
. However, I like to use that feature locally for my own purposes, and keeping track of the fixup commits I wanted to upload vs the ones I wanted to squash locally before anyone saw them became confusing.
So I used a slightly different commit message format here, and I'll manually rearrange the commits the way that --autosquash
would have when I finally squash. That's one lesson learned so far.
include/zephyr/kernel.h
Outdated
@@ -5832,6 +5832,14 @@ int k_thread_runtime_stats_get(k_tid_t thread, | |||
*/ | |||
int k_thread_runtime_stats_all_get(k_thread_runtime_stats_t *stats); | |||
|
|||
/** |
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.
Fixed in 86c2994.
include/zephyr/kernel.h
Outdated
* @param thread ID of thread | ||
* @return 0 on success, negative error code on failure | ||
*/ | ||
void z_describe_thread(k_tid_t thread, const char *description); |
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.
Fixed in fixup commits.
kernel/thread.c
Outdated
|
||
void z_describe_thread(k_tid_t thread, const char *description) | ||
{ | ||
int description_size = 1000; /* Max size of a description */ |
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.
Fixed in 46c6b6a.
@stephanosio @keith-zephyr Looking at the PR as it currently exists, how is the re-review experience? |
@alevkoy this is the wrong repo. This repo is only for testing CI and GitHub actions. |
@carlescufi I don't intend to submit this. I just want to demo a review workflow based on fixups. |
Oh apologies, I realize this now. |
Happy new year! Anyone want to take a look at my fixup commits? |
Could you explain how the auto-squash part is supposed to work? It might also be helpful if you could join the Process WG meeting next week and demonstrate how the auto-squash part is supposed to work. |
Each "FIXUP" commit refers to a previous commit in the PR. The fixup commits contain changes in response to comments. My hope is that this will make it easier for the people who originally requested the changes, e.g. you, to review the newly changed code. So please review the new commits and let me know how the experience as a reviewer is.
Once you like how the code looks, I'll perform a rebase in which I squash the fixup commits onto their corresponding previous commits. I'll then push again. This will be a force push, because I'm rewriting existing commits instead of just appending. But there should be essentially no code changes, and reviewers should be able to quickly verify that using the "compare" button in Github. I will then need to request review again, because the commits changed, but it should be a formality, because the reviewers already looked at all the code. You'll just be double checking that the commits are organized in a way that you like. If you approve, then I'll be able to submit as normal. However, I will probably not actually submit this PR, because, as noted in the commit message, the actual code change is useless. It will have served its purpose to experiment with this review process.
I'll do that. |
@alevkoy if you're going to push for this, then I would say we should at the very least be following the commit shortlog formats expected by That said I am kind of skeptical about this but I am also happy to add this to the process WG agenda for next week. Please make sure there's a corresponding issue filed with the 'Process' label in the main zephyr git repository and send me a ping on Discord or email with a link to that issue by Tuesday mid-day US pacific time and I'll make sure it's on the agenda. Thanks! |
I started out doing that, but I found that it interfered with my own behind-the-scenes use of
Done. I'll follow up on Discord. |
a8ae4ac
to
8ada639
Compare
ff9facc
to
231c7a2
Compare
52fb4c3
to
1990754
Compare
Quality Gate failedFailed conditions C Maintainability Rating on New Code (required ≥ A) See analysis details on SonarCloud Catch issues before they fail your Quality Gate with our IDE extension SonarLint |
d7cc31b
to
cd9ff80
Compare
Add a poorly declared thread function for demo purposes.
Signed-off-by: Abe Levkoy [email protected]