-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Some refactoring and fixes in the nix development environment #1827
Conversation
c49f3a0
to
8f49488
Compare
This breaks my workflow, or at least makes it less convenient and a bit suprising to any nix developer. Having the |
Suggest that we go with b) in this PR. |
Love the xkcd :D. You are right, it is not technically needed anymore. I actually wanted to add a question "Remo, I am sure there are problems with this change, what am I missing?" to that part. The background was, that I started with the Happy to remove that change :). |
Ah, one more idea: |
Yes, a file with just `import ./nix' in it should work. I see the value of having everything nix related in the nix directory, but this would also add two extra files, indirection and a bit of extra complexity, I'm not sure it's worth it. How much would it simplify the ci docker? Edit: Ah, just saw your previous comment! Yes, then I think it's best we leave it as is! :-) |
This extends the interface of withTmpDb to allow loading different sets of database fixtures via `postgrest-with-postgresql-xx --fixtures <path>`.
8f49488
to
9501045
Compare
This allows to use `postgrest-build` in CI without pulling in a lot of dependencies.
Temporary directories are now created in $TMPDIR/postgrest/script-name-XXX. This allows recognizing the origin of a single temporary directory and uploading the whole $TMPDIR/postgrest folder as an artifact in CI.
9501045
to
acccd49
Compare
Kept |
Merge time! |
There are a couple of things I needed to do for #1805, #1812 and while playing around with CI in #1822 - some of which I needed to have fixed in multiple of those PRs. To avoid juggling the same commits in the different PRs, I want to merge them ahead of time.
This PR does the following:
default.nix
andshell.nix
into thenix/
subfolder. This is to have all nix-related files in one directory, which allows to set up the context for a ci-nix-Dockerfile much easier. This adds a convenience wrapper forshell.nix
in the root directory, so thatnix-shell
can still be called the same way as before.cabalTools
fromdevTools
to allow installingpostgrest-build
in CI without the overhead of manydevtools
dependencies.postgrest-dump-schema
currently not workingnix-shell --pure
.yq
needsjq
under the hood - but it seems like it currently doesn't import it properly in it's environment. Not sure if that's fixed already upstream, but just addingjq
to the PATH fixes it for now.postgrest-coverage
needing a rebuild while running the tests, because of changed flags. The build step had--enable-tests all
, but the test step did not and so started a rebuild. Now the build targets are listed explicitly and no rebuild is needed.withTmpDir
temporary directories. They are now created in a common directory/tmp/postgrest/...
- this allows to upload all of the kept temp dirs as artifacts in CI in the case of a failed step. Also each individual temp directory is now prefixed with the name of the shell script that was run and not a generictmp.xxxx
. Makes it much easier to debug things.with_tmp_db
a truecheckedShellScript
as discussed in Addpostgrest-loadtest
based on vegeta #1812 (comment). This also helps with the Dockerfile context (see above). We still need to agree on how we handle the stack situation. The 3 suggestions we have so far are:a) Auto-generate a checked-in copy of with_tmp_db
b) just keep the original file or
c) create
postgrest-stack-build
andpostgrest-stack-test
commands and keep everything in nix.