Skip to content

Commit bf3e307

Browse files
Merge pull request #278 from osmanhadzic/update-confirmation-messages
Refactor `astartectl utils validate` interfaces, triggers
2 parents 29fac67 + 826933f commit bf3e307

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
1010
### Fixed
1111
- Allow a larger set of permissions for configuration files and folders.
1212

13+
### Added
14+
- Add validation confirmation messages for Astarte Interface and Trigger in the utils package for improved user feedback.
15+
1316
## [24.5.1] - 2024-09-19
1417
### Changed
1518
- `cluster instance` {`deploy` | `destroy` | `show`} are deprecated and

cmd/utils/interfaces.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ var validateInterfaceCmd = &cobra.Command{
3535
Note that the checks performed by this function are not as thorough as the ones performed by Astarte, so there could be false positives (but no false negatives).
3636
This command is thought to be used in CI pipelines to validate that new interfaces are "reasonable enough".
3737
38-
Returns 0 and does not print anything if the interface is valid, returns 1 and prints an error message if it isn't.`,
38+
Returns 0 and print message if the interface is valid, returns 1 and prints an error message if it isn't.`,
3939
Example: ` astartectl utils interfaces validate com.my.Interface.json`,
4040
Args: cobra.ExactArgs(1),
4141
RunE: validateInterfaceF,
@@ -57,5 +57,7 @@ func validateInterfaceF(command *cobra.Command, args []string) error {
5757
os.Exit(1)
5858
}
5959

60+
fmt.Printf("%s is a valid Astarte Interface\n", interfacePath)
61+
6062
return nil
6163
}

cmd/utils/triggers.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ var validateTriggerCmd = &cobra.Command{
3535
Note that the checks performed by this function are not as thorough as the ones performed by Astarte, so there could be false positives (but no false negatives).
3636
This command is thought to be used in CI pipelines to validate that new triggers are "reasonable enough".
3737
38-
Returns 0 and does not print anything if the trigger is valid, returns 1 and prints an error message if it isn't.`,
38+
Returns 0 and print message if the trigger is valid, returns 1 and prints an error message if it isn't.`,
3939
Example: ` astartectl utils triggers validate my_trigger.json`,
4040
Args: cobra.ExactArgs(1),
4141
RunE: validateTriggerF,
@@ -57,5 +57,7 @@ func validateTriggerF(command *cobra.Command, args []string) error {
5757
os.Exit(1)
5858
}
5959

60+
fmt.Printf("%s is a valid Astarte Trigger\n", triggerPath)
61+
6062
return nil
6163
}

0 commit comments

Comments
 (0)