Skip to content
This repository has been archived by the owner on Dec 11, 2024. It is now read-only.

Commit

Permalink
Fix bug when republishing after aborted attempt (#31)
Browse files Browse the repository at this point in the history
* Fix bug when republishing after aborted attempt

The bug was caused because prior to this commit we were only
incrementing the lastPublished counter if publishing succeeded. This
meant that for instance if publishing was aborted the very first time
that the plugin was ran, it would fail again afterwards as it would
mistakenly think there had been a manual edit of the Confluence space.

The fix in this commit is to ensure that we also increment the
lastPublished counter when there is an error encountered during
publishing.

* Bump plugin patch version
  • Loading branch information
johnboyes authored Aug 9, 2021
1 parent 85ad2e2 commit 968e4e0
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 1 deletion.
19 changes: 19 additions & 0 deletions functional-tests/specs/duplicate_scenario_headings.spec
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,22 @@ chance of duplicate spec headings.
* Output contains <result>
* Output contains <message>

## Republishing after fixing the duplicate spec headings or directory names works fine

* Publish specs to Confluence:

|heading|
|-------|
|same |
|same |

* Output contains "Failed: 2 specs have the same heading"

* Publish specs to Confluence:

|heading |
|-------------|
|same same |
|but different|

* Output contains "Success"
2 changes: 2 additions & 0 deletions internal/confluence/publisher.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,9 @@ func (p *Publisher) Publish(specPaths []string) {
}

if err != nil {
p.space.updateLastPublished() //nolint:errcheck,gosec
p.printFailureMessage(err)

return
}

Expand Down
2 changes: 1 addition & 1 deletion plugin.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"id": "confluence",
"version": "0.10.1",
"version": "0.10.2",
"name": "Confluence",
"description": "Publishes Gauge specifications to Confluence",
"install": {
Expand Down

0 comments on commit 968e4e0

Please sign in to comment.