-
Notifications
You must be signed in to change notification settings - Fork 196
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
Add database migrations as an Ant target #9823
base: master
Are you sure you want to change the base?
Conversation
👋 Hello! Thanks for contributing to our project. You can see the progress at the end of this page and at https://github.com/uyuni-project/uyuni/pull/9823/checks If you are unsure the failing tests are related to your code, you can check the "reference jobs". These are jobs that run on a scheduled time with code from master. If they fail for the same reason as your build, it means the tests or the infrastructure are broken. If they do not fail, but yours do, it means it is related to your code. Reference tests: KNOWN ISSUES Sometimes the build can fail when pulling new jar files from download.opensuse.org . This is a known limitation. Given this happens rarely, when it does, all you need to do is rerun the test. Sorry for the inconvenience. For more tips on troubleshooting, see the troubleshooting guide. Happy hacking! |
594ace1
to
c3ebf0d
Compare
3c445f0
to
9f84929
Compare
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.
Thanks for adding this. Only one remark:
I was using ant -f manager-build.xml apply-schema-migrations -Ddeploy.mode=remote-container -Ddeploy.host=<MY_SERVER>
which worked fine.
However it would be nice if we could use the default deploy mode container
using the specified CONTAINER_CONNECTION
like we do with the deploy
target.
Hmm, I'm not sure if I understand exactly what you mean @parlt91? The current implementation uses all the same flags and tooling as |
With the
If I try the same with the new
But in the end this is just some QOL and I don't necessarily see it as a hard requirement |
Hmm, I see, however as is I'm not sure why there's a difference? |
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'm wondering if instead of copying the whole upgrade directory to the server and use find --exec
we can instead create a single upgrade script using the <concat>
task. In this way we could avoid the -exec escaping problem and just execute a single time spacewalk-sql
. Version sorting would still be a problem in plain ant, though, so I doubt we can use a simple to list the files.
<echo message="Stopping spacewalk-service..." /> | ||
<deploy-execute command="spacewalk-service stop" /> | ||
|
||
<property name="match" value="susemanager-schema-5.*" /> |
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 know it's probably not possible to do better than this in plain ant, but this is not totally correct and might lead to errors.
<exec failonerror="true" executable="sh" logerror="true" outputproperty="result"> | ||
<arg line="${argline}"/> | ||
</exec> |
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.
The problem here is that the escaping of the \;
is only correct when running in remote-container
mode. When using a different mode, since the command is not passed around in the same way, find
breaks and cannot identify the --exec
parameter, as reported by @parlt91.
On top of that, I'm not sure if find
is able to sort the directories in the correct order (i.e. 5.0.9 and 5.0.10)
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.
Sorry, I selected the wrong lines. I was referring to the argline
:
<property name="argline" value="-c "${deploy.executor.command} ${deploy.executor.parameters} 'find ${deploy.temp.dir}/${match} -type f -name "*.sql" -exec spacewalk-sql --select-mode-direct {} \\\;'"" />
What does this PR change?
Add database migrations as an Ant target. Uses the existing deploy logic, so can be used locally, for a remote, etc.
GUI diff
No difference.
Documentation
No documentation needed: only internal and user invisible changes
DONE
Test coverage
ℹ️ If a major new functionality is added, it is strongly recommended that tests for the new functionality are added to the Cucumber test suite
No tests: build tooling
DONE
Links
Changelogs
Make sure the changelogs entries you are adding are compliant with https://github.com/uyuni-project/uyuni/wiki/Contributing#changelogs and https://github.com/uyuni-project/uyuni/wiki/Contributing#uyuni-projectuyuni-repository
If you don't need a changelog check, please mark this checkbox:
If you uncheck the checkbox after the PR is created, you will need to re-run
changelog_test
(see below)Re-run a test
If you need to re-run a test, please mark the related checkbox, it will be unchecked automatically once it has re-run:
Before you merge
Check How to branch and merge properly!