[prev in list] [next in list] [prev in thread] [next in thread] 

List:       bricolage-commits
Subject:    [bricoleurs/bricolage] 5d442c: Fix handling of publish failures in Ajax publish r...
From:       noreply () github ! com
Date:       2011-08-17 5:41:41
Message-ID: 20110817054141.04EE0425C0 () smtp1 ! rs ! github ! com
[Download RAW message or body]

  Branch: refs/heads/rev-2.0
  Home:   https://github.com/bricoleurs/bricolage

  Commit: 5d442c517ecb9f5ad12bb0015f0e524a6d126254
      https://github.com/bricoleurs/bricolage/commit/5d442c517ecb9f5ad12bb0015f0e524a6d126254
  Author: David E. Wheeler <david@justatheory.com>
  Date:   2011-08-16 (Tue, 16 Aug 2011)

  Changed paths:
    M comp/media/js/lib.js
  M lib/Bric/App/Callback.pm
  M lib/Bric/App/Callback/Desk.pm

  Log Message:
  -----------
  Fix handling of publish failures in Ajax publish requests.

This fixes the half of bug #277, when one attempts to publish from a desk or \
workspace.

When `PUBLISH_RELATED_FAIL_BEHAVIOR = fail` and a related asset fails to publish, we \
now call `raise_conflict` to return a 409 and do a better job displaying *all* the \
appropriate error messages.

When `PUBLISH_RELATED_FAIL_BEHAVIOR = warn` and  related asset fails to publish, we \
call a new moethod, `show_accepted()`. This method returns a 202 status code, which \
I'm abusing a bit here, but it comes closest to what we want. The story properly \
publishes and disappears from the desk, but a new handler in the Ajax code also shows \
the errors when related failed to publish. I also added code to abort at the end of \
the Desk `publish` callback when a request is Ajax so that no other stuff gets sent \
back to the browser. This is because in "warn" mode, we wnt the full request to \
succeed, with no rollbacks or anything, and all subsequent code should execute, so \
that the story will properly be published and removed from workflow.

Tomorrow I'll have to figure out what to do about non-ajax publish requests in order \
to properly and finally fix bug # 277.


  Commit: 835b0b8a9189753fd4ad64c6b52bd895dea9f55a
      https://github.com/bricoleurs/bricolage/commit/835b0b8a9189753fd4ad64c6b52bd895dea9f55a
  Author: David E. Wheeler <david@justatheory.com>
  Date:   2011-08-16 (Tue, 16 Aug 2011)

  Changed paths:
    M lib/Bric/App/Callback/Desk.pm
  M lib/Bric/App/Callback/Profile/Story.pm
  M lib/Bric/Util/Burner.pm

  Log Message:
  -----------
  Move fixes for Bug #277.

With `PUBLISH_RELATED_FAIL_BEHAVIOR = fail`, things work fine now when publishing via \
"Check in and Publish" in the story profile and when selecting that option on a desk \
or workflow, which is an Ajax call.

One side effect is that if the publish fails because the story itself fails to \
publish (rather than because a related fails), the story is instantly checked out to \
the user again and put back into workflow. In the interrim, the asset will have been \
checked in, so the result is a new version number. I think that this is a very minor \
issue that most folks won't even notice, and is far better than what we had, where \
things were checked in and sometimes removed from workflow. This is better: other \
than the new version, it looks like the same page as before, with all the same data, \
but a nice status message explaining the failure.

In order to properly catch an error when there are no destinations, that exception is \
now thorwn as an "invalid error" exception rather than a fatal exception. That \
indicates that it's something to inform the user of, rather than something unexpected \
(which is a 500). Looking at it, I think it was silly to have been throwing a burn \
error for that particular error; an invalid error is a much better choice.

Still to do to finish fixing this bug:

* Fix media to follow the same pattern.
* Make sure that `PUBLISH_RELATED_FAIL_BEHAVIOR = warn` works as expected
* Make sure that publishing from search results works as expected
* Make sure that bulk publish works as expected.
* Make sure all tests continue to pass.

[#277 state:open]


  Commit: adb204561191a1ee8766dc8f5446c88540a0c1c3
      https://github.com/bricoleurs/bricolage/commit/adb204561191a1ee8766dc8f5446c88540a0c1c3
  Author: David E. Wheeler <david@justatheory.com>
  Date:   2011-08-16 (Tue, 16 Aug 2011)

  Changed paths:
    M lib/Bric/App/Callback/Profile/Media.pm

  Log Message:
  -----------
  Make media publish work the same as story publish.

More work on [#277 state:open].


  Commit: 438aba5c162bd0b94c521ada79fcb5cb7092cf48
      https://github.com/bricoleurs/bricolage/commit/438aba5c162bd0b94c521ada79fcb5cb7092cf48
  Author: David E. Wheeler <david@justatheory.com>
  Date:   2011-08-16 (Tue, 16 Aug 2011)

  Changed paths:
    M lib/Bric/App/Callback/Desk.pm
  M lib/Bric/App/Callback/Profile/Media.pm
  M lib/Bric/App/Callback/Profile/Story.pm

  Log Message:
  -----------
  Yet more fixes for Bug #277.

Still with `PUBLISH_RELATED_FAIL_BEHAVIOR = fail`, make sure publishes that fail \
because realteds fail to publish works properly both from desks and from document \
profiles.

While at it, I filled in some other gaps in the publish logging and rollback logic in \
the Desk callback.

[#277 state:open]


  Commit: 74b39e626e2c47a6134638829420544b3973f53c
      https://github.com/bricoleurs/bricolage/commit/74b39e626e2c47a6134638829420544b3973f53c
  Author: David E. Wheeler <david@justatheory.com>
  Date:   2011-08-16 (Tue, 16 Aug 2011)

  Changed paths:
    M lib/Bric/App/Callback/Desk.pm

  Log Message:
  -----------
  More Bug # 277 fixes.

This time, always die on non-ajax requests. This allows the "publish later" option on \
the Publish desk to throw an error and return to the same page, rather than load the \
scheduling page and show the error there.


  Commit: b8f4919598d8a3270636f79dd3504e06a7892412
      https://github.com/bricoleurs/bricolage/commit/b8f4919598d8a3270636f79dd3504e06a7892412
  Author: David E. Wheeler <david@justatheory.com>
  Date:   2011-08-16 (Tue, 16 Aug 2011)

  Changed paths:
    M lib/Bric/App/Callback/Desk.pm

  Log Message:
  -----------
  Fold $is_ajax into $allow_fail to simplify things.


  Commit: 4f5355384b64f424cb471b44d10c1e746d482b2b
      https://github.com/bricoleurs/bricolage/commit/4f5355384b64f424cb471b44d10c1e746d482b2b
  Author: David E. Wheeler <david@justatheory.com>
  Date:   2011-08-16 (Tue, 16 Aug 2011)

  Changed paths:
    M lib/Bric/Changes.pod

  Log Message:
  -----------
  Not fix for Bug #277.


Compare: https://github.com/bricoleurs/bricolage/compare/58ee2b9...4f53553


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic