Skip to content
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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Conversation

sayboras
Copy link
Member

No description provided.

This script is no longer used, it's better to remove it and all related
script.

Signed-off-by: Tam Mach <[email protected]>
@maintainer-s-little-helper maintainer-s-little-helper bot added the dont-merge/needs-release-note-label The author needs to describe the release impact of these changes. label May 10, 2024
@sayboras sayboras added the release-note/misc This PR makes changes that have no direct user impact. label May 10, 2024
@maintainer-s-little-helper maintainer-s-little-helper bot removed the dont-merge/needs-release-note-label The author needs to describe the release impact of these changes. label May 10, 2024
@sayboras
Copy link
Member Author

/test

@sayboras sayboras marked this pull request as ready for review May 10, 2024 14:31
@sayboras sayboras requested a review from a team as a code owner May 10, 2024 14:31
@sayboras sayboras requested a review from qmonnet May 10, 2024 14:31
@qmonnet qmonnet requested a review from a team May 10, 2024 16:52
Copy link
Member

@qmonnet qmonnet left a 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.

@qmonnet qmonnet added the kind/cleanup This includes no functional changes. label May 10, 2024
Copy link
Member

@joestringer joestringer left a 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.

Comment on lines -10 to -31
# 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
}
Copy link
Member

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.

Copy link
Member

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?

Copy link
Member

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.

@maintainer-s-little-helper maintainer-s-little-helper bot added ready-to-merge This PR has passed all tests and received consensus from code owners to merge. labels May 10, 2024
@squeed squeed removed the ready-to-merge This PR has passed all tests and received consensus from code owners to merge. label May 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/cleanup This includes no functional changes. release-note/misc This PR makes changes that have no direct user impact.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants