Commit Graph

608 Commits

Author SHA1 Message Date
Ryan Mulligan
a0a2e6afbe use Polysemy for File and Process, add test for quotedUrls
regenerate haskell nix file (drops hex dependency)

apply ormolu to a few files

fixup cabal file

add polysemy logger interpretation of Output, fix bug in nixEvalSem bug

* nixEvalSem was accidentally not stripping the output

create test_data and simplify RewriteSpec to use it

move Polysemy interpretation stacks closer to where polysemy methods are made

eventually these will move more top level but for now this keeps it
more contained

update to ghc883, remove raw-strings-qq dep
2020-04-04 14:08:14 -07:00
Ryan Mulligan
423f23d02a
Merge pull request #171 from bhipple/fix/logFname
Emit logfile names with ISO 8601 standard dates
2020-03-29 19:13:57 -07:00
Ryan Mulligan
4faa5c4d9d
Merge pull request #173 from bhipple/u/build
Infrastructure upgrades to bump dependencies and cleanup build system
2020-03-29 19:12:43 -07:00
Ryan Mulligan
523681c6d8 Infrastructure upgrades to bump dependencies and cleanup build system
No functional change; this pulls out all of the changes except the `polysemy`
refactoring from here:
https://github.com/ryantm/nixpkgs-update/pull/172

This will allow us to do development with the newer GHC and cleaned up
dependency stack, start using the `hspec` test suite, vet the `github` library
updates, etc., while we work on porting more of the effects to polysemy and
evaluating how it looks.
2020-03-29 20:06:44 -04:00
Benjamin Hipple
8d60bb2dc6 Emit logfile names with ISO 8601 standard dates
Namely, `YYYY-MM-DD.log`
2020-03-28 15:55:09 -04:00
Benjamin Hipple
32c439cf9a
Merge pull request #170 from bhipple/u/workflow-name
Name workflow "CI" instead of "Test"
2020-03-28 14:19:23 -04:00
Benjamin Hipple
ebdd022d2b Name workflow "CI" instead of "Test"
This looks a little cleaner (`CI/tests` vs. `Test/tests`), and allows us space
to add more parallel workflows like `CI/format`.
2020-03-28 14:08:15 -04:00
Ryan Mulligan
9f877d24ab
Merge pull request #167 from bhipple/u/readme
readme: update log location and replace travis build badge w/ github actions
2020-03-28 08:32:52 -07:00
Benjamin Hipple
17ec228f20 readme: update log location and replace travis build badge w/ github actions 2020-03-28 11:30:40 -04:00
Ryan Mulligan
96aad84da6 remove double nix build 2020-03-13 21:30:05 -07:00
Ryan Mulligan
5ca5d0738b remove travis ci 2020-03-13 21:28:08 -07:00
Ryan Mulligan
11969210dd add our cachix cache 2020-03-13 21:16:41 -07:00
Ryan Mulligan
9158a03c2b try to add github actions CI 2020-03-13 21:02:23 -07:00
Ryan Mulligan
321c8c59b2
Merge pull request #163 from bhipple/feature/golang
Automated updates for buildGoModule packages
2020-03-12 21:59:58 -07:00
Benjamin Hipple
acd94d2502 Automated updates for buildGoModule packages
Having merged an update to make go packages passthru the `modSha256` [1], we can
now have `nixpkgs-update` inspect it and make updates, just as it now does for
Rust packages as of [2].

As a slight detail, because the attribute is in `passthru` rather than actually
being available in the derivation, we just do the equivalent of
`nix eval -f . <attrPath>.<attr>` rather than going through the `drvAttrs` as before.

This version has been tested successfully with at least one go update [3], but
not thoroughly vetted. That said, it's essentially identical to the Rust
implementation that has been working well for some time now.

[1] https://github.com/NixOS/nixpkgs/pull/82027
[2] https://github.com/ryantm/nixpkgs-update/pull/156
[3] https://github.com/NixOS/nixpkgs/pull/82465
2020-03-13 00:09:37 -04:00
Ryan Mulligan
7baffa1faf
Merge pull request #162 from bhipple/u/more-refactoring
No-op cleanups
2020-03-12 18:00:15 -07:00
Benjamin Hipple
98a13f8140 No-op cleanups
- Put the Rust version rewriter ahead of the quoted urls rewriter, so it shows
  up first in the PR description. This is a much more significant/important
  update than the homepage quoting, so it should be emphasized first.
- Sorting the export orders
- Now that we capture rewriter args with `args@(..)`, some of these vars are
  unused and generating compiler warnings.
- Fix some comments
2020-03-12 20:47:40 -04:00
Ryan Mulligan
50a9afd90a
Merge pull request #161 from bhipple/u/refactor
Refactor rewriters to reduce duplication
2020-03-11 15:00:45 -07:00
Benjamin Hipple
9e523697e4 Capture args when destructuring to pass to function call 2020-03-11 17:38:41 -04:00
Benjamin Hipple
e6b4b7574c Refactor rewriters to reduce duplication
This commit moves the meat of the standard `src` and `version` update into a
helper function that can be re-used across the regular version updater and the
Rust package updater.

Since I am soon to add it to a third place for updating Golang packages, which
structurally look a lot like Rust updates, I think it makes sense to move this
to a helper function rather than copy it in a third place.

Also adds a newline in front of the section on `Updates Performed` to make the
PR comment prettier.

All in all, no functional changes intended, just cleanups/prep for more features.
2020-03-07 16:44:52 -05:00
Ryan Mulligan
e7d49c65ea
Merge pull request #160 from bhipple/feature/blacklist-ghc
Blacklist all GHC package updates
2020-03-07 08:38:55 -08:00
Benjamin Hipple
a200c8fa27 Blacklist all GHC package updates
These are versioned per-file and should not be updated in-place; see here for details:
https://github.com/NixOS/nixpkgs/pull/81897

This also cleans up some formatting/spelling/consistency on the other log
mesages, but makes no material change there.
2020-03-07 10:22:13 -05:00
Jan Tojnar
aa0fabfa37
Blacklist: kill GNOME updates
It’s that time of year again.
2020-03-06 12:31:33 +01:00
Ryan Mulligan
c90f605282 Rewrite: standardize log messages a bit 2020-03-05 17:36:28 -08:00
Ryan Mulligan
a8f095a28f
Merge pull request #156 from bhipple/feature/rust-update
Automated updates for buildRustPackage Applications
2020-03-04 22:30:21 -08:00
Benjamin Hipple
3da9745b70 Automated updates for buildRustPackages applications 2020-03-05 01:02:30 -05:00
Ryan Mulligan
41f004062f
Merge pull request #159 from bhipple/feature/prep-multi-version
Move assertions to prepare for other updaters that can change version
2020-03-04 21:12:12 -08:00
Benjamin Hipple
d4dcf63bb4 Safety check fix based on PR feedback 2020-03-05 00:09:08 -05:00
Benjamin Hipple
860fa5ed1c Move assertions to prepare for other updaters that can change version
No functional change intended, but please review carefully, as this is mostly untested!

Previously:

1. The assertion about having a single sha was at the top-level, and
2. The assertion that the rewrite changed something meaningful (src url version,
   output hash) was inlined inside the `version` rewrite rule.

This commit moves the single-sha limitation down into `version`, and moves the
"did we change something meaningful" check out of `version` and into the top-level.

This is a no-op refactoring to prepare for adding other rewrite rules which CAN
process multiple shas, such as update functions for Rust and Go packages. Like
the regular version one, these should still be constrained by the requirement
that they actually make a "real" version bump change, e.g. change the `src` and
`outputHash`.
2020-02-28 00:39:18 -05:00
Ryan Mulligan
f940c1b953
Merge pull request #158 from ryantm/fixurl
File.replace now returns whether it changed something; also fix Rewri…
2020-02-26 07:58:41 -08:00
Ryan Mulligan
ac280f818c File.replace now returns whether it changed something; also fix Rewrite.quotedUrls
fixes #157
2020-02-25 20:55:56 -08:00
Ryan Mulligan
5d32deb0dd
Merge pull request #154 from bhipple/feature/log-diff
Just print the diff once at the end of rewrites
2020-02-24 10:01:06 -08:00
Ryan Mulligan
5857b16c7a
Merge pull request #153 from bhipple/feature/url-quote-simplify
Simplify branching logic for quotedUrls
2020-02-24 04:21:52 -08:00
Benjamin Hipple
92ceda5247 Just print the diff once at the end of rewrites
Particularly as we add more specific rewrite functions, the norm is that most of
them will not generate a diff on a particular update, so the in-between diff
should be mostly the same. This keeps the log clean by just printing the final
diff; since we have msgs for rewrites fired we can still (somewhat) investigate
what did what when things go wrong.
2020-02-23 17:06:07 -05:00
Benjamin Hipple
5ff454e991 Simplify branching logic for quotedUrls
Rather than enumerate all the negative cases and then fall through to a
modification, let's instead specify the 1 case where something needs to be done,
and otherwise do nothing.
2020-02-23 16:58:36 -05:00
Ryan Mulligan
c83606ad6a
Merge pull request #152 from bhipple/feature/quoted-url-comment-fix
Minor bugfix for quoted urls when homepage is not in the file
2020-02-22 21:13:43 -08:00
Benjamin Hipple
ab8116c83d Minor bugfix for quoted urls when homepage is not in the file
The rewriter would do the right thing, but the comment would still show up in
the PR description. This adds a check to the quotedUrls rewriter to handle the
case where the homepage DOES exist and is NOT quoted, but also would not be it
by the text replace, because it inherits it from another file.
2020-02-22 22:38:13 -05:00
Ryan Mulligan
4caed3a481 add in checks that were accidentally removed in 8c3666da 2020-02-22 09:43:43 -08:00
Ryan Mulligan
15ac6569b2 fixup what happens when not calculating outpaths 2020-02-21 22:46:44 -08:00
Ryan Mulligan
e975989799 url rewriter: fix case where there is no meta.homepage 2020-02-21 22:34:28 -08:00
Ryan Mulligan
a68ef0f734 format Update with ormolu 2020-02-21 22:21:10 -08:00
Ryan Mulligan
f2253ab02d hide slow outpaths behind flag 2020-02-21 22:20:50 -08:00
Ryan Mulligan
26ab5d56ea
Merge pull request #151 from bhipple/feature/rewrite-contract
Cleanup the comment on the Rewrite function contract
2020-02-20 05:10:52 -08:00
Benjamin Hipple
28b4c37136 Cleanup the comment on the Rewrite function contract 2020-02-20 00:55:04 -05:00
Ryan Mulligan
c27502b6cf
Merge pull request #150 from bhipple/feature/pr-msgs-rewriters
Allow rewrite jobs to return a message for the PR
2020-02-19 21:47:49 -08:00
Benjamin Hipple
891cdfa83a Allow rewrite jobs to return a message for the PR
The version bump rewrite doesn't really need a message, since that's already in
the PR title; but other rewrites should probably provide some context by linking
to a ticket.

The first of these is the homepage quoting for [1], but I will also want this
for the cargo fetcher rewriter [2].

[1] https://github.com/NixOS/rfcs/pull/45
[2] https://github.com/NixOS/nixpkgs/issues/79975
2020-02-20 00:39:47 -05:00
Ryan Mulligan
8d04d159d8
Merge pull request #149 from bhipple/feature/dry-run
Fix dry run, and git diff, and start adding better logging
2020-02-19 21:34:02 -08:00
Benjamin Hipple
4a3a2637c1 Options are already in updateEnv 2020-02-20 00:31:16 -05:00
Benjamin Hipple
aa12991740 Fix dry run, and git diff, and start adding better logging
Previously, the `--dry-run` would still call `hub pull-request`, and would also
refuse to run if there were a similar PR open on GitHub.

This also adds more logging information and prints `git diff` in the log as the
last step in dry runs. Since some rewriters may take a long time to run, it's
useful for interactive development to have status streaming into the logfile as
they process.
2020-02-19 23:55:19 -05:00
Ryan Mulligan
cbd1733009 Merge branch 'feature/homepage-fixer' 2020-02-19 19:40:34 -08:00