Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

taskwarrior: support taskwarrior3 migration #5782

Conversation

trueNAHO
Copy link
Contributor

@trueNAHO trueNAHO commented Aug 30, 2024

Description

Support taskwarrior3 migration, following the approach in NixOS/nixpkgs#303632 to avoid breaking changes.

Closes: #5310

Checklist

  • Change is backwards compatible.

  • Code formatted with ./format.

  • Code tested through nix-shell --pure tests -A run.all or nix develop --ignore-environment .#all using Flakes.

  • Test cases updated/added. See example.

  • Commit messages are formatted like

    {component}: {description}
    
    {long description}
    

    See CONTRIBUTING for more information and recent commit messages for examples.

  • If this PR adds a new module

    • Added myself as module maintainer. See example.

Maintainer CC

trueNAHO added a commit to trueNAHO/home-manager that referenced this pull request Aug 30, 2024
Support taskwarrior3 migration, following the approach in [1] to avoid
breaking changes.

[1]: NixOS/nixpkgs#303632

Closes: nix-community#5310
Link: nix-community#5782
@trueNAHO trueNAHO force-pushed the taskwarrior-support-taskwarrior3-migration branch 2 times, most recently from dc63b75 to b9c9bd0 Compare August 30, 2024 19:23
trueNAHO added a commit to trueNAHO/home-manager that referenced this pull request Aug 30, 2024
Support taskwarrior3 migration, following the approach in [1] to avoid
breaking changes.

[1]: NixOS/nixpkgs#303632

Closes: nix-community#5310
Link: nix-community#5782
@trueNAHO trueNAHO marked this pull request as draft August 30, 2024 19:24
@trueNAHO trueNAHO marked this pull request as ready for review August 30, 2024 20:08
Copy link
Contributor

@pacien pacien left a comment

Choose a reason for hiding this comment

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

Diff looks good to me 👍
(Note: I didn't test the changes as I don't use this program anymore.)

The default package should perhaps be set to taskwarrior3 for stateVersions more recent than the current stable?
This would be more consistent with what is being tested in the module test too.

@trueNAHO
Copy link
Contributor Author

trueNAHO commented Aug 31, 2024

(Note: I didn't test the changes as I don't use this program anymore.)

Did you find a better alternative for your needs?

The default package should perhaps be set to taskwarrior3 for stateVersions more recent than the current stable?

Users not already on taskwarrior3 receive the following warning:

trace: evaluation warning: taskwarrior was replaced by taskwarrior3, which requires manual transition from taskwarrior 2.6, read upstram's docs: https://taskwarrior.org/docs/upgrade-3/

Avoiding the breaking change of setting pkgs.taskwarrior3 as the new default aligns with the approach in NixOS/nixpkgs#303632. Until Nixpkgs hard deprecates taskwarrior2, we should follow their approach.

This would be more consistent with what is being tested in the module test too.

Are you referring to the following:

diff --git a/tests/modules/programs/taskwarrior/taskwarrior.nix b/tests/modules/programs/taskwarrior/taskwarrior.nix
index f21198f5732b..ea6cde3a1316 100644
--- a/tests/modules/programs/taskwarrior/taskwarrior.nix
+++ b/tests/modules/programs/taskwarrior/taskwarrior.nix
@@ -16,6 +16,7 @@ with lib;
         include /my/stuff
         urgency.user.tag.test.coefficient=-42.42
       '';
+      package = pkgs.taskwarrior3;
     };

     test.stubs.taskwarrior = { };

I added this to verify that pkgs.taskwarrior3 still exists if it ever gets replaced with pkgs.taskwarrior in the future. This makes it easier to spot when to partially revert this patch.

@Leixb
Copy link
Contributor

Leixb commented Sep 1, 2024

LGTM, I agree with following the nixpkgs approach.

I am not sure if setting a taskwarrior3 in the test is a good idea. In my opinion, it's better to ensure that the default option is valid than checking that the example option is.

@pacien
Copy link
Contributor

pacien commented Sep 6, 2024

This other PR has been merged and covers the taskwarrior-sync part: #5802

Support taskwarrior3 migration, following the approach in [1] to avoid
breaking changes.

[1]: NixOS/nixpkgs#303632

Closes: nix-community#5310
Link: nix-community#5782
@rycee rycee force-pushed the taskwarrior-support-taskwarrior3-migration branch from b9c9bd0 to aaebdea Compare September 7, 2024 07:42
@rycee rycee merged commit aaebdea into nix-community:master Sep 7, 2024
1 of 3 checks passed
@rycee
Copy link
Member

rycee commented Sep 7, 2024

Thanks! I've adjusted for the previously merged taskwarrior-sync PR and merged this PR to master now 🙂

PerchunPak pushed a commit to PerchunPak/home-manager that referenced this pull request Sep 17, 2024
Support taskwarrior3 migration, following the approach in [1] to avoid
breaking changes.

[1]: NixOS/nixpkgs#303632

Closes: nix-community#5310
Link: nix-community#5782
brckd pushed a commit to brckd/home-manager that referenced this pull request Sep 24, 2024
Support taskwarrior3 migration, following the approach in [1] to avoid
breaking changes.

[1]: NixOS/nixpkgs#303632

Closes: nix-community#5310
Link: nix-community#5782
Mikilio pushed a commit to Mikilio/home-manager that referenced this pull request Oct 11, 2024
Support taskwarrior3 migration, following the approach in [1] to avoid
breaking changes.

[1]: NixOS/nixpkgs#303632

Closes: nix-community#5310
Link: nix-community#5782
Noodlez1232 pushed a commit to Noodlez1232/home-manager that referenced this pull request Nov 21, 2024
Support taskwarrior3 migration, following the approach in [1] to avoid
breaking changes.

[1]: NixOS/nixpkgs#303632

Closes: nix-community#5310
Link: nix-community#5782
colonelpanic8 pushed a commit to colonelpanic8/home-manager that referenced this pull request Dec 30, 2024
Support taskwarrior3 migration, following the approach in [1] to avoid
breaking changes.

[1]: NixOS/nixpkgs#303632

Closes: nix-community#5310
Link: nix-community#5782
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.

Upgrade programs.taskwarrior to use taskwarrior3
4 participants