@@ -316,12 +316,13 @@ data Publish
316 | PublishShortReadme
316 | PublishShortReadme
317 | PublishNoLicense
317 | PublishNoLicense
318 | PublishBuildProblem BuildProblem
318 | PublishBuildProblem BuildProblem
319+ | PublishMissingTag V.Version
319− | PublishCannotGetTag Http.Error
320+ | PublishCannotGetTag V.Version Http.Error
321+ | PublishCannotGetTagData V.Version String BS.ByteString
320 | PublishCannotGetZip Http.Error
322 | PublishCannotGetZip Http.Error
321 | PublishCannotDecodeZip
323 | PublishCannotDecodeZip
322 | PublishCannotGetDocs V.Version V.Version DocsProblem
324 | PublishCannotGetDocs V.Version V.Version DocsProblem
323 | PublishCannotRegister Http.Error
325 | PublishCannotRegister Http.Error
324− | PublishMissingTag V.Version
325 | PublishNoGit
326 | PublishNoGit
326 | PublishLocalChanges V.Version
327 | PublishLocalChanges V.Version
@@ -484,23 +485,6 @@ publishToReport publish =
484 PublishBuildProblem buildProblem ->
485 PublishBuildProblem buildProblem ->
485 error "TODO PublishBuildProblem" buildProblem
486 error "TODO PublishBuildProblem" buildProblem
487− PublishCannotGetTag httpError ->
488− error "TODO PublishCannotGetTag" httpError
490− PublishCannotGetZip httpError ->
491− error "TODO PublishCannotGetZip" httpError
493− PublishCannotDecodeZip ->
494− error "TODO PublishCannotDecodeZip"
496− PublishCannotGetDocs old new docsProblem ->
497− toDocsProblemReport docsProblem $
498− "I need the docs for " ++ V.toChars old ++ " to verify that "
499− ++ V.toChars new ++ " really does come next"
501− PublishCannotRegister httpError ->
502− error "TODO PublishCannotRegister" httpError
504 PublishMissingTag version ->
488 PublishMissingTag version ->
505 let vsn = V.toChars version in
489 let vsn = V.toChars version in
506 Help.docReport "NO TAG" Nothing
490 Help.docReport "NO TAG" Nothing
@@ -520,6 +504,59 @@ publishToReport publish =
520 , "The -m flag is for a helpful message. Try to make it more informative!"
504 , "The -m flag is for a helpful message. Try to make it more informative!"
507+ PublishCannotGetTag version httpError ->
509+ Http.BadHttp _ (HTTP.StatusCodeException response _)
510+ | HTTP.statusCode (HTTP.responseStatus response) == 404 ->
511+ let vsn = V.toChars version in
512+ Help.report "NO TAG ON GITHUB" Nothing
513+ ("You have version " ++ vsn ++ " tagged locally, but not on GitHub.")
515+ "Run the following command to make this tag available on GitHub:"
516+ , D.indent 4 $ D.dullyellow $ D.fromChars $
517+ "git push origin " ++ vsn
519+ "This will make it possible to find your code online based on the version number."
523+ toHttpErrorReport "PROBLEM VERIFYING TAG" httpError
524+ "I need to check that the version tag is registered on GitHub"
526+ PublishCannotGetTagData version url body ->
527+ Help.report "PROBLEM VERIFYING TAG" Nothing
528+ ("I need to check that version " ++ V.toChars version ++ " is tagged on GitHub, so I fetched:")
529+ [ D.indent 4 $ D.dullyellow $ D.fromChars url
531+ "I got the data back, but it was not what I was expecting. The response\
532+ \ body contains " ++ show (BS.length body) ++ " bytes. Here is the "
533+ ++ if BS.length body <= 76 then "whole thing:" else "beginning:"
534+ , D.indent 4 $ D.dullyellow $ D.fromChars $
535+ if BS.length body <= 76
536+ then BS_UTF8.toString body
537+ else take 73 (BS_UTF8.toString body) ++ "..."
539+ "Does this error keep showing up? Maybe there is something weird with your\
540+ \ internet connection. We have gotten reports that schools, businesses,\
541+ \ airports, etc. sometimes intercept requests and add things to the body\
542+ \ or change its contents entirely. Could that be the problem?"
545+ PublishCannotGetZip httpError ->
546+ toHttpErrorReport "PROBLEM DOWNLOADING CODE" httpError $
547+ "I need to check that folks can download and build the source code when they install this package"
549+ PublishCannotDecodeZip ->
550+ error "TODO PublishCannotDecodeZip"
552+ PublishCannotGetDocs old new docsProblem ->
553+ toDocsProblemReport docsProblem $
554+ "I need the docs for " ++ V.toChars old ++ " to verify that "
555+ ++ V.toChars new ++ " really does come next"
557+ PublishCannotRegister httpError ->
558+ error "TODO PublishCannotRegister" httpError
523 PublishNoGit ->
560 PublishNoGit ->
524 Help.report "NO GIT" Nothing
561 Help.report "NO GIT" Nothing
525 "I searched your PATH environment variable for `git` and could not\
562 "I searched your PATH environment variable for `git` and could not\
@@ -599,10 +636,10 @@ toDocsProblemReport :: DocsProblem -> String -> Help.Report
599toDocsProblemReport problem context =
636toDocsProblemReport problem context =
600 case problem of
637 case problem of
601 DP_Http httpError ->
638 DP_Http httpError ->
602− toHttpErrorReport "PROBLEM FETCHING DOCS" httpError context
639+ toHttpErrorReport "PROBLEM LOADING DOCS" httpError context
604 DP_Data url body ->
641 DP_Data url body ->
605− Help.report "PROBLEM FETCHING DOCS" Nothing (context ++ ", so I fetched:")
642+ Help.report "PROBLEM LOADING DOCS" Nothing (context ++ ", so I fetched:")
606 [ D.indent 4 $ D.dullyellow $ D.fromChars url
643 [ D.indent 4 $ D.dullyellow $ D.fromChars url
607 , D.reflow $
644 , D.reflow $
608 "I got the data back, but it was not what I was expecting. The response\
645 "I got the data back, but it was not what I was expecting. The response\