Skip to content

Deprecate usethis ci in v0.19.0 ahead of removal in v0.20.0#1416

Merged
nathanjmcdougall merged 3 commits intomainfrom
copilot/deprecate-support-for-usethis-ci
Mar 13, 2026
Merged

Deprecate usethis ci in v0.19.0 ahead of removal in v0.20.0#1416
nathanjmcdougall merged 3 commits intomainfrom
copilot/deprecate-support-for-usethis-ci

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 13, 2026

usethis ci (Bitbucket Pipelines support) is being phased out — CI config is too bespoke, schema maintenance is a burden, and the feature is orthogonal to usethis's core Python tooling focus.

Changes

  • src/usethis/_ui/interface/ci.py — Added deprecated=True to typer.Typer() constructor (deprecates the entire ci app, triggering typer's built-in DeprecationWarning when invoked via the main app) and a warn_print call explicitly naming v0.20.0 as the removal version
  • src/usethis/_ui/app.py — Added deprecated=True to app.add_typer() for ci so the command appears deprecated in usethis --help
  • tests/usethis/_ui/interface/test_ci.py — Updated exact-output assertions to include the deprecation warning line

When invoked via usethis ci, users now see:

DeprecationWarning: The command 'ci' is deprecated.
⚠ 'usethis ci' is deprecated and will be removed in v0.20.0.
Original prompt

This section details on the original issue you should resolve

<issue_title>Deprecate support for usethis ci</issue_title>
<issue_description>It was an interesting experiment but Bitbucket pipelines is quite limited and testing it is hard. Issues like #1312 scare me a bit.

I'm dreading adding support for GitHub actions, which has a completely different sort of ecosystem, including externalized repos. It is quite dangerous from a security perspective (zizmor would need to be integrated into the test suite to provide assurance that the files usethis generates are secure, but even then it feels like a weak guarantee).

I'm considering the trade-off of continuing to support CI config architecturally versus giving up on it and keeping usethis focused on pure Python config, and leaving CI for the bespoke ways that people like to configure it.

In a commercial context, CI often uploads results to internal servers etc. so it will almost never be fully abstracted in the way that usethis envisages.

Most tools run through pytest and prek/pre-commit so the extra benefit of adding CI config seems very low compared to the complexity of what I'm needing to build/maintain. And it's really quite orthogonal to the main objectives of this project.

It's also a maintenance burden, as schemas change, I have to bump them regularly e.g. #412 #926, #1299, etc.

R usethis has "questioning" lifecycle marked for CI config and doesn't have it for GitHub. And I don't think it tries to do what usethis Python is trying to do right now in terms of dynamic population of the CI config file.
</issue_description>

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

@nathanjmcdougall The more I think about this, the more I think it's the right move.

I think usethis adds the most benefit for routine, low cognitive load tasks where users are copy-and-pasting stuff from the documentation. CI is not like that.

CI is quite bespoke. Even for Bitbucket pipelines, I'm already making assumptions about the way the user does things (sticking everything in one pipeline; the default pipeline). We'll always assume a protocol/convention for job/step names which is dubious. GitHub is even more free-for-all and the CI config is not necessarily confined to one file. Then there's release pipelines etc. which are still bound up with the project. I think basically this is just too hard. I don't have the time or the desire to try and get usethis to tackle it.

Best practices for CI change a lot. Whereas tools try to avoid breaking changes, I fear that major architectural decisions around best practice may change over time.</comment_new>
<comment_new>@nathanjmcdougall
Another thought - performance will improve by removing CI integrations.

OK, I think I'll put in a deprecation warning in usethis 0.19.0 that usethis ci will be removed in usethis 0.20.0, and mention this is in the docs. At v0.20.0, I will keep all the existing code infrastructure in place but remove the actual CLI command, replacing it with a message requesting user feedback on this tracker issue. I should also open a ticket at that point to write docs explaining why usethis doesn't cover CI. And from then on I will just be pragmatic about removing anything I don't see value in keeping.

I'm also going through the backlog labelling things as ci so that I can close them as unplanned but still be able to come back to them as ideas if we ever revisit it.

@nathanjmcdougall Should use the docs here for how to deprecate a CLI command using typer: https://typer.tiangolo.com/tutorial/commands/help/#deprecate-a-command

Basically just the @app.command(deprecated=True) command. We should also add a warn_print call explaining specifically when the command will be deprecated (i.e. the version). Tests can be updated correspondingly to pass them.</comment_new>


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Co-authored-by: nathanjmcdougall <18602289+nathanjmcdougall@users.noreply.github.com>
Copilot AI changed the title [WIP] Deprecate support for usethis ci Deprecate usethis ci in v0.19.0 ahead of removal in v0.20.0 Mar 13, 2026
Copilot AI requested a review from nathanjmcdougall March 13, 2026 05:14
@nathanjmcdougall nathanjmcdougall marked this pull request as ready for review March 13, 2026 05:48
@codspeed-hq
Copy link
Copy Markdown

codspeed-hq bot commented Mar 13, 2026

Merging this PR will not alter performance

✅ 2 untouched benchmarks


Comparing copilot/deprecate-support-for-usethis-ci (4384225) with main (a2fa80d)

Open in CodSpeed

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 13, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

@nathanjmcdougall
Copy link
Copy Markdown
Collaborator

@copilot actually I think we're better to deprecate the whole app instead of just the bitbucket subcommand:

app = typer.Typer(deprecated=True)

We can keep the warn_print call though.

Co-authored-by: nathanjmcdougall <18602289+nathanjmcdougall@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Mar 13, 2026

@copilot actually I think we're better to deprecate the whole app instead of just the bitbucket subcommand:

app = typer.Typer(deprecated=True)
...

Done in 4384225. Moved deprecated=True to app = typer.Typer(..., deprecated=True) and removed it from @app.command(). The warn_print call is kept in the bitbucket function body.

Copilot AI requested a review from nathanjmcdougall March 13, 2026 08:00
@nathanjmcdougall nathanjmcdougall merged commit c00d2f0 into main Mar 13, 2026
20 checks passed
@nathanjmcdougall nathanjmcdougall deleted the copilot/deprecate-support-for-usethis-ci branch March 13, 2026 08:12
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.

Deprecate support for usethis ci

2 participants