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

Build CLI: Configurations on User Level & CI Improvements #2129

Merged
merged 16 commits into from
Nov 5, 2024

Conversation

AmmarAbouZor
Copy link
Member

@AmmarAbouZor AmmarAbouZor commented Oct 22, 2024

This PR closes #2119
This PR closes #2140
This PR closes #2141

It provides a way for the users to configure their environment and preferences in a file in Chipmunk home directory to be loaded and used by the build CLI tool

It Provides fixes improvements in fixes to run CI checks which are described in the linked issues.

The following configuration are provided currently:

  • The Shell to run the processes on (Bash, Zsh, Fish...)
  • Default UI preference to use with the tool (bars, report, print, immediate)

Roadmap:

  • Implement user configurations as singleton with their load method
  • Provide an enum to represent the shell running by users with methods to provide command to run process in the selected shell.
  • Replace the implementation global commands function with the one from the user configurations.
  • Add CLI commands to print the path of the configuration file and dump the default configurations to stdout and to the configuration file.
  • Validate given shell before running any further commands.
  • Consider preferred UI mode form the configuration.
  • Use default values for not defined configurations
  • Extend integration tests.
  • Extend README.
  • Increase tool version.
  • Timeout for all spawned tasks to prevent stuck task from running in GitHub actions forever.
  • Remove specified targets on test commands in CI checks
  • Use cargo to install wasm-pack
  • Print error logs to stderr in immediate mode.
  • Print info line for skipped jobs in immediate mode.
  • Test on Windows.
  • Test on MacOS.

@AmmarAbouZor AmmarAbouZor force-pushed the build_cli_config branch 2 times, most recently from b6c0285 to b662bc4 Compare October 23, 2024 07:37
@AmmarAbouZor AmmarAbouZor marked this pull request as ready for review October 23, 2024 09:29
@AmmarAbouZor
Copy link
Member Author

@DmitryAstafyev The default shell will be retrieved from SHELL environment variable.
I'll test this PR on Linux and Windows, but could you please test it on MacOS

cli/CHANGELOG.md Outdated Show resolved Hide resolved
@AmmarAbouZor
Copy link
Member Author

Test passes on Windows

* Implement user configurations as singleton with their load method
* Provide an enum to represent the shell running by users with methods
  to provide command to run process in the selected shell.
* Replace the implementation global commands function with the one from
  the user configurations
* Extend benchmarks configurations error message to avoid confusion
  between different kinds of configurations.
* Documentations
* Add commands to print the path of the configurations file, printing
  the defaults to stdout and writing the default to configuration file
  if not exist
* Remove the part of creating the needed directories for chipmunk and
  build CLI home directories.
* Ensure that the configured shell exists on the system before running
  any further commands.
* Change method name from cmd to bin
* UI mode will be loaded from user configuration if not specified as CLI
  argument
* Release command doesn't consider the UI mode in configuration file.
Use default values when configs don't exist to avoid forcing the users
to specify all options
* Default shell is platform specific and they must not be shown
  on platform where are not supported (like `cmd` on Linux)
* Set default shell to `zsh` on MacOs.
* Default shell is installed by default and doesn't need an extra check,
  which can be faulty since `sh` doesn't provide a version argument
* Add test for user configuration commands
* Change command naming alias
* Use environment variables to figure out the default shells on
  unix-based platforms
* Use `cmd` on Windows
* Update README file with configuration section
* Increase tool version & Update Changelog
* Move use statement to fix warning on Windows
@AmmarAbouZor AmmarAbouZor marked this pull request as draft October 31, 2024 14:25
Build CLI tool will automatically pick all targets that have tests
if no target is specified.
This will fix ignoring targets the not mentioned targets like CLI
Installing using cargo will ensure it will work on all platform in
addition to caching it with the action cargo-cache
* Print logs of errors to stderr with UI mode `immediate` to improve
  highlighting the errors within GitHub actions
* Add missing copy trait to small enum
Show logs immediately on CI checks
@AmmarAbouZor AmmarAbouZor changed the title Build CLI: Configurations on User Level Build CLI: Configurations on User Level & CI Improvements Oct 31, 2024
* In immediate mode there is no other indicator that the jobs has been
  skipped without progress bars and reports
@AmmarAbouZor AmmarAbouZor marked this pull request as ready for review November 4, 2024 09:01
@AmmarAbouZor AmmarAbouZor marked this pull request as draft November 4, 2024 09:25
* Use cargo to install wasm-pack packages to ensure cross-platform
  support and utilize caching with cargo-cache action
@AmmarAbouZor AmmarAbouZor marked this pull request as ready for review November 4, 2024 10:02
@AmmarAbouZor
Copy link
Member Author

Timeout has been implemented within CI checks themselves instead of building them inside the CLI tool itself

@DmitryAstafyev DmitryAstafyev merged commit 542668f into esrlabs:master Nov 5, 2024
4 checks passed
@AmmarAbouZor AmmarAbouZor deleted the build_cli_config branch November 5, 2024 08:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants