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

feat/add fishtape option to fish feature #25

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

edouard-lopez
Copy link

@edouard-lopez edouard-lopez commented Nov 7, 2022

Adding fisher_plugins to @guiyomh's fish feature.

Usage

"features": {
    "ghcr.io/meaningful-ooo/devcontainer-features/fish:1": {
        "fisher_plugins": "jorgebucaran/fishtape pure-fish/pure"
    }
}

Options

Options Id Description Type Default Value
fisher_plugins Install Fish's plugins using fisher string ""

@edouard-lopez edouard-lopez force-pushed the feat/add-fishtape-option-to-fish-feature branch from 29038ca to a2df261 Compare November 7, 2022 10:12
@eitsupi
Copy link
Collaborator

eitsupi commented Nov 7, 2022

Thank you for working on this.

But I don't think we should add any more plugins here to be installed by fisher. (I don't think that's a sustainable approach)

Users can install their favorite plug-ins in an instant by simply copying the ~/.config/fish/fish_plugins file created by fisher into the container and executing the fisher update command.

@andreiborisov
Copy link
Member

@edouard-lopez hello, friend! 👋🏻

But I don't think we should add any more plugins here to be installed by Fisher (I don't think that's a sustainable approach).

Maybe we can use an array for plugins to install instead? @eitsupi @edouard-lopez what do you think?

@eitsupi
Copy link
Collaborator

eitsupi commented Nov 7, 2022

Maybe we can use an array for plugins to install instead?

I think adding an array would be a good idea. 👍

Comment on lines +26 to +28

[fisher]: https://github.com/jorgebucaran/fisher
[fishtape]: https://github.com/jorgebucaran/fishtape
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do not edit README.md directly as it is automatically generated from devcontainer-feature.json and NOTES.md.

@andreiborisov
Copy link
Member

I think adding an array would be a good idea. 👍

The only issue, there is no array type for options: https://containers.dev/implementors/features/#options-property 😓

@edouard-lopez edouard-lopez marked this pull request as draft November 7, 2022 11:29
@eitsupi
Copy link
Collaborator

eitsupi commented Nov 7, 2022

A string type option that allows specifying plug-ins as a string separated by spaces or commas would be suitable.

"plugins": "jorgebucaran/nvm.fish meaningful-ooo/sponge"

@andreiborisov
Copy link
Member

@edouard-lopez is this PR time-sensitive? There is a proposal to add arrays to the spec: devcontainers/spec#57. I prefer to wait for it instead of hardcoding specific plugins.

@edouard-lopez
Copy link
Author

Array sounds good to me, it's not time-sensitive so we can wait or use @eitsupi workaround

@andreiborisov
Copy link
Member

A string type option that allows specifying plug-ins as a string separated by spaces or commas would be suitable.

Good idea! Let's wait for a reply from the spec maintainers and decide if we want to use this workaround or wait for the proper array support.

@edouard-lopez
Copy link
Author

I updated the code to support a fisher_plugins options and added 2 scenarios to test the options.

BTW, Are you aware of solution to test a single scenario with devcontainer features test?

@andreiborisov andreiborisov self-requested a review November 7, 2022 18:46
@andreiborisov
Copy link
Member

@andreiborisov andreiborisov self-assigned this Nov 7, 2022
@edouard-lopez edouard-lopez marked this pull request as ready for review November 8, 2022 09:16
@edouard-lopez
Copy link
Author

@andreiborisov, are you aware the linear links are not accessible to others?
image

Copy link
Collaborator

@eitsupi eitsupi left a comment

Choose a reason for hiding this comment

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

Thank you for working on this.
I think the updates regarding the development environment, such as justfile commits, should be separated from the PR, but anyway some small comments regarding the Feature.

@@ -9,6 +9,11 @@
"type": "boolean",
"default": true,
"description": "Install Fisher plugin manager"
},
"fisher_plugins": {
Copy link
Collaborator

Choose a reason for hiding this comment

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

It should be camelCase.

Suggested change
"fisher_plugins": {
"fisherPlugins": {

@@ -118,6 +119,24 @@ if [ "${FISHER}" = "true" ]; then
fish -c "fisher -v"
fi

# Install Fisher plugins
if [ -n "${FISHER_PLUGINS}" ]; then
Copy link
Collaborator

Choose a reason for hiding this comment

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

fisher should be installed.

Suggested change
if [ -n "${FISHER_PLUGINS}" ]; then
if [ "${FISHER}" = "true" ] && [ -n "${FISHERPLUGINS}" ]; then

@@ -1,6 +1,7 @@
#!/usr/bin/env bash

FISHER=${FISHER:-"true"}
FISHER_PLUGINS=${FISHER_PLUGINS:-""}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
FISHER_PLUGINS=${FISHER_PLUGINS:-""}
FISHERPLUGINS=${FISHERPLUGINS:-""}

Copy link
Member

@andreiborisov andreiborisov Nov 10, 2022

Choose a reason for hiding this comment

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

I propose to go with the same approach maintainers currently use in https://github.com/devcontainers/features: devcontainers/spec#57 (comment)

I think it's a little bit more readable in options and they can effectively migrate us later when the proper arrays will become supported:

BASH_ARRAY=( ${COMMA_SEPARATED_OPTION//,/ } )

Vote with 👍 or 👎, please.

@eitsupi
Copy link
Collaborator

eitsupi commented Nov 8, 2022

Are you aware of solution to test a single scenario with devcontainer features test?

Running only scenario tests can be done as follows, but I believe that running only one scenario is not supported.
We will probably need to rewrite the json file using jq.

run: devcontainer features test -f ${{ matrix.features }} --skip-autogenerated .

@andreiborisov
Copy link
Member

andreiborisov commented Nov 8, 2022

Are you aware the Linear links are not accessible to others?

@edouard-lopez yes, I've wanted to invite you via Twitter (I've lost your Telegram contact 🥲), but it might be that your notifications for DMs are disabled.

Ping me, please, on Telegram or Twitter 🤙🏻

Copy link
Member

@andreiborisov andreiborisov left a comment

Choose a reason for hiding this comment

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

Thank you for working on this PR! 🙏🏻

Copy link
Member

@andreiborisov andreiborisov left a comment

Choose a reason for hiding this comment

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

We don't have proper commit guidelines yet: https://linear.app/meaningful/issue/SYM-5/commit-style-guide, so I apologize for the chaos.

Although we might arrive at a style similar to what you've used in your commits, right now it's pure gitmoji without scope or type (the type is actually redundant since gitmoji already serves this purpose).

I would love to hear your thoughts on all this if you want to discuss it 🤙🏻

## Install

```console
yarn install
Copy link
Member

@andreiborisov andreiborisov Nov 10, 2022

Choose a reason for hiding this comment

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

We already use pnpm as it's faster compared to yarn.

Copy link
Member

@andreiborisov andreiborisov Nov 10, 2022

Choose a reason for hiding this comment

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

Contributing guidelines is a huge topic for Meaningful, so they're developed separately to be used organization-wide: https://linear.app/meaningful/issue/GRA-8/contributing-guidelines

The goal is to be as modular and reusable as we possibly can.

Pass a `feature` and a `base image`, _e.g._:

```fish
just test fish mcr.microsoft.com/devcontainers/base:debian
Copy link
Member

Choose a reason for hiding this comment

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

There is also https://github.com/go-task/task which looks good. Before committing to something, we should compare those (sorry for being pedantic, I'd like those decisions to be organization-wide so it requires a certain level of scrupulousness).

@@ -1,6 +1,7 @@
#!/usr/bin/env bash

FISHER=${FISHER:-"true"}
FISHER_PLUGINS=${FISHER_PLUGINS:-""}
Copy link
Member

@andreiborisov andreiborisov Nov 10, 2022

Choose a reason for hiding this comment

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

I propose to go with the same approach maintainers currently use in https://github.com/devcontainers/features: devcontainers/spec#57 (comment)

I think it's a little bit more readable in options and they can effectively migrate us later when the proper arrays will become supported:

BASH_ARRAY=( ${COMMA_SEPARATED_OPTION//,/ } )

Vote with 👍 or 👎, please.

@andreiborisov
Copy link
Member

@eitsupi thank you for helping with the review, I was quite slow this time 🐢

## Install

```console
yarn install
Copy link
Member

@andreiborisov andreiborisov Nov 10, 2022

Choose a reason for hiding this comment

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

Contributing guidelines is a huge topic for Meaningful, so they're developed separately to be used organization-wide: https://linear.app/meaningful/issue/GRA-8/contributing-guidelines

The goal is to be as modular and reusable as we possibly can.

@eitsupi
Copy link
Collaborator

eitsupi commented Nov 11, 2022

Are you aware of solution to test a single scenario with devcontainer features test?

Running only scenario tests can be done as follows, but I believe that running only one scenario is not supported.

FYI devcontainers/cli#272

@eitsupi
Copy link
Collaborator

eitsupi commented Dec 15, 2022

Any update on this?

@andreiborisov andreiborisov marked this pull request as draft December 19, 2022 07:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants