Skip to content

Add IgnoreStopIfOnceExists setting for write-only deployments#879

Merged
KevinJump merged 4 commits intov17/mainfrom
copilot/enhance-usync-stop-support
Jan 26, 2026
Merged

Add IgnoreStopIfOnceExists setting for write-only deployments#879
KevinJump merged 4 commits intov17/mainfrom
copilot/enhance-usync-stop-support

Conversation

Copy link
Contributor

Copilot AI commented Jan 15, 2026

Write-only deployments (e.g., WebDeploy without "remove files" option) leave usync.stop files from previous runs, blocking subsequent imports even when a new usync.once file is deployed.

Changes

Configuration

  • Added IgnoreStopIfOnceExists boolean setting (default: false)
  • When enabled, usync.once overrides usync.stop blocking behavior

Implementation

  • Extracted import decision logic into ShouldProceedWithImport() method
  • Added HasOnceFile() helper to check once file existence
  • Import now proceeds when: no stop file exists, OR (stop file + setting enabled + once file exists)

Usage

{
  "uSync": {
    "Settings": {
      "ImportAtStartup": "Settings",
      "IgnoreStopIfOnceExists": true
    }
  }
}

With this setting, deployments can include fresh usync.once files without removing old usync.stop files from disk.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • www.myget.org
    • Triggering command: /usr/bin/dotnet dotnet build uSync.BackOffice/uSync.BackOffice.csproj -c Release (dns block)
    • Triggering command: /usr/bin/dotnet dotnet build uSync.BackOffice/uSync.BackOffice.csproj --no-restore -c Release (dns block)
    • Triggering command: /opt/hostedtoolcache/CodeQL/2.23.8/x64/codeql/csharp/tools/linux64/Semmle.Autobuild.CSharp /opt/hostedtoolcache/CodeQL/2.23.8/x64/codeql/csharp/tools/linux64/Semmle.Autobuild.CSharp (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>Enhance usync.once/stop to support write only deployment</issue_title>
<issue_description>Hi,

We are using "write only" deploment (webdeploy without the option remove remote files first), and I can't find a way to use the usync.once / stop file.

My uSync configuration:

  "uSync": {
    "Settings": {
      "ExportOnSave": "None"
      "ImportAtStartup": "Settings",
      "StopFile": "../usync.stop",
      "OnceFile": "../usync.once"
    }
  },
  1. I deploy the site first with a usync.once file
  2. usync run the migration, and rename the file as "usync.stop"
  3. I deploy the site a second time with a new usync.once file
  4. usync ignore the file because there is a usync.stop file present

How could I handle this kind of deployment? I am sure I am not alone deploying using a write-only process.

I have a few suggestion to handle this case, when "ImportAtStartup" is set:

  1. If a ".once" file is present, execute the import unconditionally, then rename or delete the .once file.
  2. If a ".stop" file is present, skip the import
  3. Else execute the import

This could be a breaking change if people have a deployment with the two files present (but it will only execute once).

The other option is to handle a new extension (which will cause the import to ignore the .stop for this extension only), or a new setting link "OnceHavePriority": true to enable the suggested behavior.

Thanks,</issue_description>

<agent_instructions>add a new setting called "IgnoreStopIfOnceExists" to resolve this issue, change the logic around the uSync during start-up to implement this change. </agent_instructions>

Comments on the Issue (you are @copilot in this section)

@KevinJump Hi,

Yes, I think, a new option like "OnceHavePriority" is probably the way we can go with this, its no breaking then, and shouldn't be too hard to add 🤞 </comment_new>


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI changed the title [WIP] Enhance usync.once/stop for write only deployment Add IgnoreStopIfOnceExists setting for write-only deployments Jan 15, 2026
Copilot AI requested a review from KevinJump January 15, 2026 10:34
@KevinJump KevinJump marked this pull request as ready for review January 26, 2026 09:57
Copy link
Owner

@KevinJump KevinJump left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested works as expected

@KevinJump KevinJump merged commit 9fe0c21 into v17/main Jan 26, 2026
4 checks passed
@KevinJump KevinJump deleted the copilot/enhance-usync-stop-support branch January 26, 2026 09:58
alexsee pushed a commit to alexsee/umbraco-container that referenced this pull request Mar 7, 2026
[//]: # (dependabot-start)
⚠️  **Dependabot is rebasing this PR** ⚠️ 

Rebasing might not happen immediately, so don't worry if this takes some
time.

Note: if you make any changes to this PR yourself, they will take
precedence over the rebase.

---

[//]: # (dependabot-end)

Updated [uSync](https://github.com/KevinJump/uSync) from 17.0.2 to
17.0.4.

<details>
<summary>Release notes</summary>

_Sourced from [uSync's
releases](https://github.com/KevinJump/uSync/releases)._

## 17.0.3

This is a patch release of uSync for Umbraco v17 - it contains some
fixes for reported issues.

> [!NOTE]
> This version supports all versions of Umbraco v17.*

## What's Changed
* ⭐ Add IgnoreStopIfOnceExists setting for write-only deployments by
@​Copilot in KevinJump/uSync#879
* ⭐ Add cleanup in DocumentUrl tables when the content key changes. by
@​KevinJump in KevinJump/uSync#869
* ⭐ refresh the trees in settings when uSync finishes an import by
@​KevinJump in KevinJump/uSync#892
* ⭐ V17/extension example by @​KevinJump in
KevinJump/uSync#888
* Ensure we don't build the extend examples unless we are in debug. by
@​KevinJump in KevinJump/uSync#889
* 🐛 Fix - when descriptions are blank, they get filled with 'null' by
@​KevinJump in KevinJump/uSync#890
* 🐛 Fix - don't save 'null' in property type description name by
@​KevinJump in KevinJump/uSync#891
* ⬆️ update readme by @​KevinJump in
KevinJump/uSync#893
* ⬆️ move to centralised package management by @​KevinJump in
KevinJump/uSync#894
* ⬆️ update dependencies by @​KevinJump in
KevinJump/uSync#895
* ⬆️ add explicity JsonConverters to all enums, so they are always
serialized as strings by @​KevinJump in
KevinJump/uSync#897
* 🆙 V17/last synced date by @​KevinJump in
KevinJump/uSync#898
* ⬆️ V17/object property extensions by @​KevinJump in
KevinJump/uSync#896

**Full Changelog**:
KevinJump/uSync@v17.0.2...v17.0.4

Commits viewable in [compare
view](https://github.com/KevinJump/uSync/commits).
</details>

Updated [uSync.Complete](https://jumoo.co.uk/uSync/complete) from 17.0.1
to 17.1.1.

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enhance usync.once/stop to support write only deployment

2 participants