Skip to content

Changes 'spo file add' overwrite default. Closes #7100 - #7563

Open
waldekmastykarz wants to merge 1 commit into
pnp:mainfrom
waldekmastykarz:waldekmastykarz-spo-file-overwrite-default
Open

Changes 'spo file add' overwrite default. Closes #7100#7563
waldekmastykarz wants to merge 1 commit into
pnp:mainfrom
waldekmastykarz:waldekmastykarz-spo-file-overwrite-default

Conversation

@waldekmastykarz

Copy link
Copy Markdown
Member

Closes #7100

Changes --overwrite to a flag that defaults to false and updates the command documentation and tests.

Closes pnp#7100

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@waldekmastykarz waldekmastykarz added the pr-major PR for the next major release label Sep 2, 2026
@MartinM85 MartinM85 self-assigned this Sep 2, 2026
@MartinM85
MartinM85 requested a lite review from Copilot September 3, 2026 06:27

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

The new default “do not overwrite” behavior can still overwrite in edge cases because the upload request uses overwrite=true and relies on a pre-check that can be bypassed by races/transient errors.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

This PR updates the SharePoint spo file add command to make --overwrite a boolean flag that defaults to false, aligning the command behavior with the post-#7099 decision captured in #7100.

Changes:

  • Converted --overwrite from an optional boolean value (--overwrite [overwrite]) to a flag (--overwrite) and removed the deprecation warning about a future default change.
  • Updated unit tests to reflect the new default behavior (error when a file exists unless --overwrite is specified).
  • Updated command documentation to reflect --overwrite as a flag (no explicit true/false values or default shown).
File summaries
File Description
src/m365/spo/commands/file/file-add.ts Switches --overwrite to a flag and updates the default flow to treat missing --overwrite as “do not overwrite”.
src/m365/spo/commands/file/file-add.spec.ts Updates tests to align with the new default behavior and explicit overwrite usage.
docs/docs/cmd/spo/file/file-add.mdx Updates option docs to represent --overwrite as a flag.
Review details
  • Files reviewed: 3/3 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/m365/spo/commands/file/file-add.ts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-major PR for the next major release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

spo file add change defaults

3 participants