-
-
Notifications
You must be signed in to change notification settings - Fork 54
Maintenance tasks for repository lmms #198
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
tresf
left a comment
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.
Hourly may be overkill, don't you think?
It is only a |
Done. |
I like the thought that went into the For example... here's the entire task in 34 lines with comments. I haven't tested the below code but in addition to the above points... When run interactively, it should be apparent what it's doing for support purposes. #!/bin/sh
# Exit on any non-zero return codes; force en_US locale
set -e && LC_ALL=C
mkdir -p ~/lmms-repo && cd ~/lmms-repo
if [ -e lmms ]; then
cd lmms && PULLRES=$(git pull)
if [ "$PULLRES" = "Already up-to-date." ]; then
exit
fi
else
git clone -b master https://github.com/LMMS/lmms && cd lmms
fi
# Update CONTRIBUTORS
git shortlog -sne | cut -c 8- > doc/CONTRIBUTORS
# Update PROJECT_YEAR
YEAR=$(date -u +%Y)
while true; do
if [ "$(git log -n 1 --since=$YEAR-01-01T00:00:00Z)" ]; then
break
fi
YEAR=$((YEAR - 1))
done
sed -e "/^SET(PROJECT_YEAR / c \SET(PROJECT_YEAR $YEAR)" -i CMakeLists.txt
# Commit changes, if any
if [ "$(git diff)" ]; then
git add -u && git commit -m "Maintenance tasks"
git push origin master
fi |
No, not yet. |
It is needed to run the tasks at most once, otherwise the tasks would run each hour.
The point is to easily add, enable and debug tasks; they are like standalone plug-ins. Each task should have its own commit actually. More tasks are expected to be developed.
This is an option, but not necessary.
Option 1, with SSH:
Option 2, with password:
|
If it only commits changes, I don't see how this statement is valid.
That's an opinion. As the site maintainer, I won't merge it in this condition. If another maintainer disagrees you can work with them.
This is speculative.
Thanks. I'll post back to this thread once setup. |
Break single commit into task commits
|
The goal is scalability.
The tasks would not make any commit, but they would still run (do you remember?).
Why would you not want a system that is based on
I mentioned some possible tasks: remove executable bits, optimize PNG images, format code, etc. Do you want me to add another task? |
What you're referencing is the question if hourly was overkill. Your argument I felt was valid.
Still, I don't like magic lock files. They're bad design as they require manual cleanup when things fail. Last, I don't even understand the purpose of this one. I can't see a logical scenario when it's warranted.
Very good points. Sorry for the delay on the SSH push config. Will set that up ASAP. |
There is no cleanup, lock files do not need to be removed. These locks are released when the process finishes. AFAIK, this is the best way to have only one instance per service.
It is defensive coding. The case is when the process lasts more than an hour somehow. This may happen if networking goes slow, if the server is heavy loaded, if a task is deadlocked, if we include 60 one-minute tasks, etc. If this happens, we do not want a second instance to interfere with the first one. I should add a protection against merge conflicts. |
In the future, it is very unlikely right now. |
As is a 1-hour-long merge. |
1-hour-long process actually; I know it is unlikely. I would implement a protection against merge conflicts, but I have more pressing issues right now. The point is I would not reject an improvement. |
|
@jasp00 SSH authentication is complete.
|
|
We should test with a branch first, then switch to master, do you agree? |
Sure. |
Test with another branch
|
Ready. |
|
Should kick off in 28 minutes... @jasp00 why are the scripts in |
|
Answering my own question, dev was already there. I'm still confused as to the need for the new root directory |
|
Ok... @lukas-w put the other script in |
I chose
Sure. There are no commits in the test branch. Are you sure cron is running? Should I prepend |
|
Cron is running, there was just an authentication problem which has been fixed d2d6704. Note, the task was run interactively for testing purposes; the commits (LMMS/lmms@b990b18, LMMS/lmms@bf0e650), were done with the interactive shell and on initial clone (haven't tested pull) but initial tests pass. |
| if [ -e lmms ] | ||
| then | ||
| cd lmms | ||
| PULLRES=$(git pull) |
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.
@jasp00 should we consider appending git checkout $BRANCH to force us back onto master once ready?
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.
Sure, #214.
|
I can't find your most recent comments about the job failing but interactively tests pass, then when I scheduled the hourly to run now, it reverted the branch to the past somehow. https://github.com/LMMS/lmms/blob/maintenance-test/doc/CONTRIBUTORS |
|
Ok... @jasp00 I think we've hit a nuance with http://stackoverflow.com/questions/348170/how-to-undo-git-add-before-commit I can reproduce the flapping behavior of |
I do not think so, |
This adds an hourly cron job to maintain the repository
lmms. Is an access to GitHub set up already? A commit preparing the affected files should be done first.