habitat icon indicating copy to clipboard operation
habitat copied to clipboard

Plan Linting: Syntax within associative arrays

Open qubitrenegade opened this issue 6 years ago • 5 comments

As it stands, the following does not appear to be valid syntax for creating a pkg_binds

pkg_binds=(
  [database] = "port"
)

When attempting to start a plan with binds defined this way the following error results:

Error starting foo/bar #033[36mhab-sup#033[0m(#033[1;37mSS#033[0m)[#033[4;37mcomponents/sup/src/manager/service/spec.rs:389:24#033[0m]: Invalid bind(s), database

Additionally, this allows services to start even though the pkg_binds is defined.

Note that removing the white space around = allows the service to start normally and enforces the pkg_binds:

pkg_binds=(
-  [database] = "port"
+  [database]="port"
)

I think that errors like this should be caught at build time rather than once I've installed my package and am attempting to start it.

Related to #5112

qubitrenegade avatar Jun 06 '18 18:06 qubitrenegade

#5065

qubitrenegade avatar Jun 10 '18 06:06 qubitrenegade

Since shellcheck can catch this exact error (and many more). We should look at integrating it into the plan build process. Not sure if this fits under https://github.com/habitat-sh/habitat/issues/5065 or whether we should have a separate issue for it, but this is a good example of the kind of trickiness that would improve our UX.

baumanj avatar Jun 19 '18 18:06 baumanj

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. We value your input and contribution. Please leave a comment if this issue still affects you.

stale[bot] avatar Apr 03 '20 09:04 stale[bot]

bump?

On Fri, Apr 3, 2020 at 3:40 AM stale[bot] [email protected] wrote:

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. We value your input and contribution. Please leave a comment if this issue still affects you.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/habitat-sh/habitat/issues/5164#issuecomment-608338767, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADSBHCP2LEOC5ORDGBE7563RKWVJZANCNFSM4FDUXNNQ .

qubitrenegade avatar Apr 03 '20 11:04 qubitrenegade

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. We value your input and contribution. Please leave a comment if this issue still affects you.

stale[bot] avatar Sep 20 '22 20:09 stale[bot]

This issue has been automatically closed after being stale for 400 days. We still value your input and contribution. Please re-open the issue if desired and leave a comment with details.

stale[bot] avatar May 22 '23 01:05 stale[bot]