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

Enhancement : add a folder for non committed commands #596

Open
Bryce-Colton opened this issue Dec 22, 2024 · 2 comments
Open

Enhancement : add a folder for non committed commands #596

Bryce-Colton opened this issue Dec 22, 2024 · 2 comments

Comments

@Bryce-Colton
Copy link

Bryce-Colton commented Dec 22, 2024

It would be useful to add a feature that allows quickly adding commands to a folder that is included at installation with a .gitignore. This would enable all developers of a repo to experiment with certain commands or even add their own commands without necessarily having the permission/need to commit them to the remote repo.

What are your thoughts on this ?

Edit : The path of the folder should be available in configuration, by default the same folder of the castor.php, or something like that.

@TheoD02
Copy link
Contributor

TheoD02 commented Dec 22, 2024

Hello,

The feature you described could be useful, I’m not entirely sure it will be implemented directly in castor. Because implementing and maintaining such a feature in castor would require time and effort, and the feature can already be achieved very easily with just 2–3 manual steps.

Here’s how you can do it:

  1. Create the directory structure:

    .castor/
        castor.php
        uncommitted-tasks/ -- commited
            .gitignore -- commited, ignoring all *.php files
            example-task.php -- not commited
    
  2. Modify the castor.php file to include tasks from the uncommitted-tasks directory:

    import(__DIR__ . '/uncommitted-tasks');

With this setup, you can easily add tasks locally without pushing it to the repository.
IMO, because of this simplicity to implement manually, adding this as a built-in feature in castor may not be worth it I think

But, if this feature is very necessary for you, I believe it would be better to provide a remote package to handle it. Castor already supports extending its functionality via remote imports. You can find more details about this feature here: Castor Remote Imports

Let me know your thoughts or if you have further ideas to discuss! 😄

@Bryce-Colton
Copy link
Author

Thank you for your clear response. Indeed, I understood that this is already possible in a fairly intuitive way with Castor.

However, from a DX perspective, the goal is to provide an out-of-the-box service with no manual steps required for the user (in this case, the average developer). In an open-source context, developers are fairly independent, but in a corporate environment, this is often much less the case, and tools are frequently used in their default configuration.

It seems to me that this kind of feature, which can be easily implemented manually, should be included in the tool to facilitate its adoption.

I’m making this suggestion because on the corporate repo I’m working on, I often encounter Makefiles (which I believe are the main competitor to Castor) that I frequently adapt on my local machine to have my own custom set of commands. Sometimes I commit them when accepted by the lead devs, sometimes not, because between the time I create a command and when the person in charge of CI updates it, months can pass.

The idea of a third-party package is a good one, I’ll see if I can get Castor adopted !

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

No branches or pull requests

2 participants