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

alex/fix analytics pixels #1

Closed
wants to merge 100 commits into from
Closed

Conversation

alexbiehl
Copy link
Member

andreasabel and others added 30 commits February 11, 2022 14:19
This import is not needed since we require GHC >= 8.8.
…kell#1000,haskell#1001)

- Move `gfmExtensions` before `defaultSyntaxSpec`.

- Require commonmark-extensions-0.2.2 so `footnoteSpec` is subsumed
  under `gfmExtensions`.
  (Note: this version bump does not exclude any GHC versions.)

- Generalize `renderMarkdown` and `renderMarkdownRel` to
  `renderMarkdown'`.  We use a constraint synonym to gather
  all the constraints on type `a`, using `LANGUAGE ConstraintKinds`.

- Haddockumentation for all functions.

- Explicit export list.

Hopefully this will fix haskell#1000 and haskell#1001, but `renderMarkdown` has no
tests, so I cannot see the effect of my change locally.
Commonmark: gfmExtensions needs to precede the defaultSyntaxSpec (haskell#1000,haskell#1001)
hackage-mirror attempts to set the uploadTime in a format like "2021-12-11T12:24:35Z", but this fails with parsing using "%c". If the parse fails, try "%Y-%m-%dT%H:%M:%SZ"

Add tests for both setting and retrieving the upload-time.
The `remote-repo` configuration should be `repository`.

Also add a paragraph about cabal version 2.0 packages not showing up if you use an insecure repository mode.
…adme

Update README for cabal configuration clarity
Having it in the root directory ./ is inconvenient for some tooling
like `doctest`.
gbaz and others added 27 commits March 30, 2022 19:07
…kell#1049)

* Simplify getting all package names

* Browse: Avoid linear amount of map lookups
* Remove guardAuthorisedAsMaintainer from UploadFeature

* Remove guardAuthorisedAsMaintainerOrTrustee from UploadFeature

* Admins can view /maintain page
* BuildClient: Create installDirectory before cwd'ing to it

* BuildClient: Write absolute remote-repo-cache
* Fix some hlint warnings

* Apply review suggestions + tiny bonus fix
* Fix some hlint warnings - part 2

* Revert newtype changes
Atm. requires a patched version of `haskell-ci` 
- haskell-CI/haskell-ci#582

to include the "haddock" step.

Also: 
- fix missing `extra-source-files:` in `.cabal` file
- delete `.travis.yml`.
Following the discussion at

  UnkindPartition/tasty#327 (comment)

@andreasabel wrote:
There is a `Show` instance for `HUnitFailure` which gives the _Haskell_ representation of this exception.  So far so good.

I am looking for a function that _pretty-prints_ the exception, for presentation to the user.
It should look nicer than what `Show` gives me:
```
      Exception: HUnitFailure (Just (SrcLoc {srcLocPackage = "main", srcLocModule = "Main", srcLocFile =
"tests/PackageTestMain.hs", srcLocStartLine = 127, srcLocStartCol = 3, srcLocEndLine = 127, srcLocEndCol =
17})) (Reason "Expected success but got: \"correct-package-0.1.0.0/correct-package.cabal:11:34: \\nunexpected
Unknown cabal spec version specified: 1.10123456\\nexpecting \\\".\\\", \\\"-\\\", white space, \\\"&&\\\" or \\\"||
\\\"\\n\"")
```

@VictorCMiraldo wrote:
I started working on this today but I couldn't reproduce the problem. Eventually I discovered that @andreasabel and I did  something wrong. What we did is some variation on:

```haskell
import qualified Test.HUnit as Raw
import qualified Test.Tasty.HUnit as Tasty

t1 = Tasty.testCase "Some Test" $ Raw.assertFailure "Omg"
```

The issue comes from the fact that `Raw.HUnitAssertion` is a different type altogether from [`Tasty.HUnitAssertion`](https://github.com/UnkindPartition/tasty/blob/16289a77495eb8279c5e544886ef52503becd148/hunit/Test/Tasty/HUnit/Orig.hs#L136). Because `Tasty.Assertion == Raw.Assertion == IO ()`, and failures are communicated through exceptions, we're bypassing the `try` on [`Tasty.HUnit.run`](https://github.com/UnkindPartition/tasty/blob/master/hunit/Test/Tasty/HUnit.hs#L102) and flagging the test as failed through a random exception, since that method is `try`ing on `Tasty.HUnitAssertion`.

The solution is to *not* depend on `HUnit`, depend exclusively on `tasty-hunit` and use the functions from there. Your test failures will be printed properly then.
* Add form to update full name and email of user

* Add cache-control for user details form

* Only allow uploaders to change name/email

* Validate new name/email in UserDetails

* Simpler count of at-signs
)

* update `nix-shell` sources; use `niv`

* nix readme update

* don't use `niv`
Squashed commit of the following:

commit be261f9005d7f0382bd28e384542e141d47c4c35
Author: Peter Becich <[email protected]>
Date:   Wed Jun 1 20:17:02 2022 -0700

    Revert "test"

    This reverts commit 678a1ed.

commit 678a1ed
Author: Peter Becich <[email protected]>
Date:   Wed Jun 1 19:47:10 2022 -0700

    test

commit 7c8b2ee
Author: Peter Becich <[email protected]>
Date:   Wed May 25 18:55:42 2022 -0700

    use Cachix in GitHub Action

commit b99b637
Author: Peter Becich <[email protected]>
Date:   Tue May 24 00:17:53 2022 -0700

    attempt to fix Github Actions caching

commit 49f09ed
Author: Peter Becich <[email protected]>
Date:   Mon May 23 19:40:27 2022 -0700

    attempt to cache `/nix` in Nix Shell Github Action

    cachix/install-nix-action#56 (comment)

commit 5a5b310
Author: Peter Becich <[email protected]>
Date:   Mon May 23 19:35:18 2022 -0700

    attempt to use cache in Nix Shell Github Action

    https://github.com/cachix/install-nix-action#how-do-i-add-a-binary-cache
At present time, the information returned by the Package JSON API amounts to:

```json
{
    "author": "Hécate Moonlight",
    "copyright": "",
    "description": "The 'Display' typeclass provides a solution for user-facing output that does not have to abide by the rules of the Show typeclass.",
    "homepage": "https://github.com/haskell-text/text-display#readme",
    "license": "MIT",
    "metadata_revision": 0,
    "synopsis": "A typeclass for user-facing output"
}
```

This PR aims to implement support for the package upload timestamp in this payload.

The final result is this:

```json
{
    "author": "Hécate Moonlight",
    "copyright": "",
    "description": "The 'Display' typeclass provides a solution for user-facing output that does not have to abide by the rules of the Show typeclass.",
    "homepage": "https://github.com/haskell-text/text-display#readme",
    "license": "MIT",
    "metadata_revision": 0,
    "synopsis": "A typeclass for user-facing output",
    "uploaded_at": "2022-05-22T22:24:48.997120639Z"
}
```
The virtual-modules field is used by ghc-prim to provide a magic module
which doesn't exist on disk but still has documentation and so-on. By
including it here the module appears in the module list on the package
homepage.
@alexbiehl alexbiehl closed this Jun 27, 2022
@alexbiehl alexbiehl deleted the alex/fix-analytics-pixels branch June 27, 2022 07:41
@alexbiehl alexbiehl restored the alex/fix-analytics-pixels branch June 27, 2022 07:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet