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
contrib: Clean up un-used scripts #32456
base: main
Are you sure you want to change the base?
Conversation
This script is no longer used, it's better to remove it and all related script. Signed-off-by: Tam Mach <[email protected]>
Signed-off-by: Tam Mach <[email protected]>
Signed-off-by: Tam Mach <[email protected]>
Signed-off-by: Tam Mach <[email protected]>
/test |
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.
Sounds good to me, I'm not aware of any of these scripts being in use today. But I asked for a review from maintainers, in case they'd be aware of remaining use cases.
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.
Most of these look like old relics from earlier bash-based CI or tricks to help deploy software that wasn't widely available years ago.
watchtest
/ watchdo
are still part of my regular rotation, but I've integrated those into my own environment so it doesn't make a difference to me whether we continue to share those scripts via the Cilium repo or not.
# Watch a file or directory for changes and trigger some action at that time. | ||
# | ||
# $1 = File to watch | ||
# $2+ = Command and arguments | ||
function watchdo | ||
{ | ||
local FILE=$1 | ||
shift | ||
|
||
if [ ! -z "$TESTPKGS" ]; then | ||
echo -e "${yellow}Using TESTPKGS=\"$TESTPKGS\" for run.${t_reset}" | ||
fi | ||
echo -e "${yellow}Running \"$@\" on changes to \"$FILE\" ...${t_reset}" | ||
while inotifywait -q -r -e move $FILE; do | ||
eval "$@"; | ||
if [ $? == 0 ] ; then | ||
echo -e "${yellow}$@${t_reset}: ${green}✔${t_reset}" | ||
else | ||
echo -e "${yellow}$@${t_reset}: ${red}✘${t_reset}" | ||
fi | ||
done | ||
} |
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 happen to find this helper super useful, but I already had it in my .bashrc
and I was the one who added this into the tree to share the example with others :) I don't mind removing it if folks are discovering these tricks through other mechanisms.
One terminal: Run this command to retrigger tests whenever a file changes, then open your editor and make changes. Terminal reruns the test every time you save the file. You can iterate quite quickly on unit tests with this pattern.
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 had something similar based on inotifywait, too.]
I guess it's not a bad idea to keep these helpers somewhere for the reason you describe, but I wonder how we might make them more discoverable? Would it make sense to document them somewhere in the docs for contributing?
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.
We could. I think it's fair to say that this is out-of-scope of the actual goals of the project, but given the usefulness it's nice to have this example hosted somewhere. We could equally use a gist or such for this. So far I think the bar for contrib/
directory has just been "does any developer find this useful?", and just put things there. From time to time we may share about tips/tricks naturally on Slack or during community meetings. If you think it's worth documenting in the contribution docs, we could also do that.
No description provided.