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

pgsidekick: init at unstable-2014-11-23 #73720

Closed
wants to merge 0 commits into from
Closed

Conversation

ggPeti
Copy link
Member

@ggPeti ggPeti commented Nov 18, 2019

Motivation for this change

pglisten is a minimal program to listen to postgresql notifications, and it had no nixpkg yet.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nix-review --run "nix-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

Copy link
Member

@aanderse aanderse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The package looks simple enough. I appreciate the test, though I'm not sure what the policy on having tests for applications is... I'm under the impression that usually we don't have tests for applications unless we have specific reasons to do so... I bet @worldofpeace would know the answer to that 😄

Maybe @danbst, being one of our resident postgres experts, could give this PR a quick look over, but I think after we hear back on the testyou might just drop it (or keep it?) and we're good to go.

BTW if you end up keeping the test you'll need to add the test to the list of all tests so our bot can run it.

@ggPeti
Copy link
Member Author

ggPeti commented Nov 22, 2019

Cheers for the review, I'm ready to drop the test if that's the verdict.

@worldofpeace
Copy link
Contributor

The package looks simple enough. I appreciate the test, though I'm not sure what the policy on having tests for applications is... I'm under the impression that usually we don't have tests for applications unless we have specific reasons to do so... I bet @worldofpeace would know the answer to that smile

Maybe @danbst, being one of our resident postgres experts, could give this PR a quick look over, but I think after we hear back on the testyou might just drop it (or keep it?) and we're good to go.

BTW if you end up keeping the test you'll need to add the test to the list of all tests so our bot can run it.

A test is useful at the discretion of the maintainer. So I think if the maintainer has put the effort to have some sort of testing, 👍 to them. It'd make verifying the installation of the utilities much easier.
It's true the imperative vm tests are pretty expensive for applications, but in this case you can't verify the function without a postgresql service.

It's also not the only test for applications we have

Something like #36842 would be better for this though.
(but in this instance it does need a nixos service anyway).

Copy link
Contributor

@worldofpeace worldofpeace left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your package expression is missing proper whitespace, see most other expressions in nixpkgs.

{ stdenv }:

stdenv.mkDerivation { 
  pname = ...
  version = ...

  src = ...

  buildInputs = ...

  installPhase = ''...
  '';

  meta = {
  # these aren't usually separated by whitespace
  }
}

CREATE TRIGGER test_trg AFTER INSERT ON test FOR EACH ROW EXECUTE PROCEDURE new_row_notify();
'';
};
systemd.services.listener = {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
systemd.services.listener = {
systemd.services.listener = {

@worldofpeace
Copy link
Contributor

The package looks simple enough. I appreciate the test, though I'm not sure what the policy on having tests for applications is... I'm under the impression that usually we don't have tests for applications unless we have specific reasons to do so... I bet @worldofpeace would know the answer to that smile
Maybe @danbst, being one of our resident postgres experts, could give this PR a quick look over, but I think after we hear back on the testyou might just drop it (or keep it?) and we're good to go.
BTW if you end up keeping the test you'll need to add the test to the list of all tests so our bot can run it.

A test is useful at the discretion of the maintainer. So I think if the maintainer has put the effort to have some sort of testing, +1 to them. It'd make verifying the installation of the utilities much easier.
It's true the imperative vm tests are pretty expensive for applications, but in this case you can't verify the function without a postgresql service.

It's also not the only test for applications we have

* https://github.com/NixOS/nixpkgs/blob/master/nixos/tests/signal-desktop.nix

* https://github.com/NixOS/nixpkgs/blob/master/nixos/tests/firefox.nix

Something like #36842 would be better for this though.
(but in this instance it does need a nixos service anyway).

Then again, this repo hasn't been touched since it was published. So the test wouldn't be useful for verifying updates, just continued function with our other build expressions (because they will change).

@ggPeti
Copy link
Member Author

ggPeti commented Nov 22, 2019

pgsidekick is built against whatever postgresql this package is called with, that will change in the future. Is there any caching mechanism for VM tests so they don't run again unless something changes?

@worldofpeace
Copy link
Contributor

pgsidekick is built against whatever postgresql this package is called with, that will change in the future. Is there any caching mechanism for VM tests so they don't run again unless something changes?

I believe if you're on one rev of nixpkgs and you've built the test successfully it will return the cached output. It also seems you've forgotten to add your test to all-tests.nix, which should give it a job on hydra.

@danbst
Copy link
Contributor

danbst commented Dec 9, 2019

@ggPeti we'd merge the package (even that it is unmaintained), but can you move the test into pkgs/tools/misc/pgsidekick directory? We haven't yet created guides on how to do package testing, and even if we will have ones, the test for a package should live closer to package itself.

@worldofpeace
Copy link
Contributor

@ggPeti we'd merge the package (even that it is unmaintained), but can you move the test into pkgs/tools/misc/pgsidekick directory? We haven't yet created guides on how to do package testing, and even if we will have ones, the test for a package should live closer to package itself.

I thought we decided on add an attr in passthru

passthru.tests = { 
  pgsidekick = nixosTests.pgsidekick;
};

at least, that's what I've been doing in https://github.com/NixOS/nixpkgs/tree/master/nixos/tests/installed-tests.
We even documented it https://nixos.org/nixpkgs/manual/#sec-standard-meta-attributes passthru.tests.

@danbst
Copy link
Contributor

danbst commented Dec 9, 2019

@worldofpeace oh didn't know about installed-tests! Looks like a sane approach. I agree about adding passthru.tests as you've described.

@ggPeti would you like to finish this up?

'';

meta = with stdenv.lib; {
description = "Temporal Tables PostgreSQL Extension ";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like description is copy-pasted from other expression, right?

@stale
Copy link

stale bot commented Sep 30, 2020

Hello, I'm a bot and I thank you in the name of the community for your contributions.

Nixpkgs is a busy repository, and unfortunately sometimes PRs get left behind for too long. Nevertheless, we'd like to help committers reach the PRs that are still important. This PR has had no activity for 180 days, and so I marked it as stale, but you can rest assured it will never be closed by a non-human.

If this is still important to you and you'd like to remove the stale label, we ask that you leave a comment. Your comment can be as simple as "still important to me". But there's a bit more you can do:

If you received an approval by an unprivileged maintainer and you are just waiting for a merge, you can @ mention someone with merge permissions and ask them to help. You might be able to find someone relevant by using Git blame on the relevant files, or via GitHub's web interface. You can see if someone's a member of the nixpkgs-committers team, by hovering with the mouse over their username on the web interface, or by searching them directly on the list.

If your PR wasn't reviewed at all, it might help to find someone who's perhaps a user of the package or module you are changing, or alternatively, ask once more for a review by the maintainer of the package/module this is about. If you don't know any, you can use Git blame on the relevant files, or GitHub's web interface to find someone who touched the relevant files in the past.

If your PR has had reviews and nevertheless got stale, make sure you've responded to all of the reviewer's requests / questions. Usually when PR authors show responsibility and dedication, reviewers (privileged or not) show dedication as well. If you've pushed a change, it's possible the reviewer wasn't notified about your push via email, so you can always officially request them for a review, or just @ mention them and say you've addressed their comments.

Lastly, you can always ask for help at our Discourse Forum, or more specifically, at this thread or at #nixos' IRC channel.

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Sep 30, 2020
pkgs/tools/misc/pgsidekick/default.nix Outdated Show resolved Hide resolved
pkgs/servers/sql/postgresql/ext/pgsql_http.nix Outdated Show resolved Hide resolved
buildInputs = [ curl postgresql ];

src = fetchGit {
url = "git://github.com/pramsey/pgsql-http";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use fetchFromGitHub.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why? fetchGit is a builtin, what's wrong with using it?

@stale stale bot removed the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jan 18, 2021
@stale
Copy link

stale bot commented Jul 21, 2021

I marked this as stale due to inactivity. → More info

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jul 21, 2021
@ggPeti ggPeti closed this Aug 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants