Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improvements to Gitpod workspace and addition of Makefile for automat…
…ion (#2737) * 🆕 chore(Makefile): add Makefile to project The Makefile was added to the project. It includes targets for testing, virtualenv management, and cleaning. The Makefile is intended to simplify the development process by providing a set of commands that can be run to perform common tasks. * 🎉 feat(config.mak): add global Makefile configuration Added a global Makefile configuration file that sets the default goal to 'help', exports all variables, sets the number of cores to use, sets the shell to bash, and sets the shell flags to exit on error, pipefail, and silent. Additionally, added color variables to improve the readability of the output. * 🆕 feat(help.mak): add help command to Makefile The help command is added to the Makefile to provide a list of available commands and their descriptions. The command uses grep and awk to parse the Makefile and display the commands in a formatted way. * 🔍 chore(.gitignore): add .venv to ignore list This commit adds .venv to the ignore list to prevent it from being tracked by git. This is important because virtual environments should not be committed to the repository as they can be easily recreated by running the requirements.txt file. * 🆕 chore(.gitpod.yml): add Gitpod configuration file This commit adds a new file `.gitpod.yml` which contains the configuration for Gitpod. The configuration specifies the Dockerfile to use for the workspace image and a task to run on workspace initialization. The task runs the `make bootstrap-dev` command to set up the development environment. * 🔥 chore(requirements): remove requirements.dev.txt file The requirements.dev.txt file was removed, likely because it was no longer needed or was replaced by a different file. * 🆕 chore(python_version.config): add configuration file for Python version A new configuration file has been added to the project to specify the version of Python to be used. The file is located at `.config/python_version.config` and contains a single line specifying the Python version as `3.10`. * 🎉 feat(Dockerfile): add Dockerfile for Gitpod workspace This commit adds a Dockerfile for a Gitpod workspace. The Dockerfile installs build-time dependencies, Docker, Node.js, npm, and ungit. It also creates a gitpod user with UID 33333. The Dockerfile is split into multiple stages to optimize the build process and reduce the image size. * 🆕 chore(gitpod.mak): add Gitpod make targets for building, linting, and testing This commit adds three new make targets for Gitpod: gitpod-build, gitpod-lint, and gitpod-tests. The gitpod-build target runs a docker build command to build a local image of the postgresql_cluster. The gitpod-lint target runs a hadolint command to lint the Dockerfile. The gitpod-tests target runs the gitpod-build and gitpod-lint targets. These targets are useful for developers who want to test their changes in a Gitpod environment. * 🎉 feat(python.mak): add makefile for python virtual environment management This commit adds a makefile for managing python virtual environments. It includes targets for creating, upgrading, and installing requirements for the virtual environment. It also includes targets for installing linters and running tests. This makefile will help to ensure that the python environment is consistent across different machines and will make it easier to manage dependencies. * 🆕 chore(requirements.txt): add new development dependencies Added new development dependencies to the requirements.txt file. These dependencies include gitpython, jsonschema, jsonpickle, mkdocs, multiprocessing_logging, pychalk, pygithub, python-gitlab, azure-devops, commentjson, pytablewriter, pytest-cov, pytest-timeout, pytest-xdist, pyyaml, regex, requests, terminaltables, webpreview, yq, importlib-metadata, mkdocs-material, pymdown-extensions, mkdocs-glightbox, mdx_truly_sane_lists, beautifulsoup4, giturlparse, json-schema-for-humans, and fastapi. These dependencies are required for the development of the project. * 🚚 chore(Dockerfile): move dev requirements file to a more appropriate location The dev requirements file was moved from the root directory to a more appropriate location in the .config/python/dev directory. This improves the organization of the project and makes it easier to find the dev requirements file. * 🔧 chore(CONTRIBUTING.md): update pip install command to use new requirements file location The pip install command has been updated to use the new location of the requirements file, which is now located in the `.config/python/dev` directory. This change was made to improve the organization of the project files. * 🐛 fix(build-command.yml): update path to requirements.dev.txt to .config/python/dev/requirements.txt The path to the requirements file was incorrect and has been updated to the correct path. This ensures that the correct dependencies are installed during the build process. * 🆕 chore(gitpod.yml): add Gitpod workflow to run tests on push and pull request events This commit adds a new Gitpod workflow to run tests on push and pull request events. The workflow runs on Ubuntu latest and sets up Python 3.10. It installs dependencies and runs Gitpod tests using the `make gitpod-tests` command. The `nick-invision/retry@v2` action is used to retry the command up to 3 times with a timeout of 10 minutes. The `TERM` environment variable is also set to `xterm` to avoid issues with the terminal. * 🔥 chore(.dockerignore): add .venv to ignore list The .venv directory is added to the ignore list to prevent it from being included in the Docker image. This directory contains the virtual environment and its dependencies, which are not required in the Docker image. * 🚀 feat(Dockerfile): add markdown-table-formatter package to the Docker image The markdown-table-formatter package is now installed in the Docker image. This package is useful for formatting markdown tables in a more readable way. * 📝 docs(CONTRIBUTING.md): update contribution guidelines This commit updates the contribution guidelines to provide more detailed instructions on how to contribute to the project. It adds a step-by-step guide on how to fork the repository, make changes, test the changes, and submit a pull request. It also includes instructions on how to use Gitpod for a cloud-based development environment and how to install the necessary dependencies for a desktop environment. Finally, it adds a note to consider sponsoring the maintainer via GitHub. * 🐛 fix(.gitpod.yml): remove "-dev" from "bootstrap-dev" task name The "-dev" suffix was removed from the "bootstrap" task name to match the updated Makefile. * 🚀 feat(Makefile): add nodejs-bootstrap and nodejs-clean targets to Makefile The Makefile now includes two new targets, nodejs-bootstrap and nodejs-clean, which respectively bootstrap and clean the Node.js environment. This is useful for development as it allows for the installation of Node.js dependencies and the ability to clean them up when necessary. * 🚀 chore(package.json): add markdown-table-formatter dependency The markdown-table-formatter package has been added as a dependency to the project. This package will be used to format tables in markdown files. * 🔥 chore(Dockerfile): remove unnecessary whitespace The commit removes an unnecessary whitespace in the Dockerfile. * 🆕 chore(megalinter.mak): add megalinter-test target to run script build.sh This commit adds a new make target called megalinter-test which runs the build.sh script. The script is run in a virtual environment specified by the .venv directory. * 🆕 feat(nodejs.mak): add make targets for cleaning and bootstrapping Node.js dependencies This commit adds two new make targets to the nodejs.mak file. The `nodejs-clean` target removes the node_modules directory, and the `nodejs-bootstrap` target installs the Node.js dependencies using npm. These targets make it easier to manage the Node.js dependencies of the project. * 🐛 fix(CONTRIBUTING.md): update make command names to match their functionality The `make` command names `reinitialization-dev` and `bootstrap-dev` were changed to `reinitialization` and `bootstrap` respectively to better reflect their functionality. * 🔧 chore(Dockerfile): add mega-linter-runner package to Dockerfile The Dockerfile has been updated to include the mega-linter-runner package with version 7.0.0. This package is used to run the Mega-Linter tool, which is a linter that supports multiple programming languages and formats. This change will allow the tool to be used within the Gitpod environment. * 🔥 chore(.gitignore): add megalinter_file_names_cspell.txt to ignore list The megalinter_file_names_cspell.txt file is now being ignored by git. This file is not needed for the project and was causing unnecessary clutter in the repository. * 🔍 chore(.mega-linter.yml): update FILTER_REGEX_EXCLUDE to exclude new directories and files The FILTER_REGEX_EXCLUDE has been updated to exclude the newly added directories and files. The .venv directory has been added to SPELL_MISSPELL_FILTER_REGEX_EXCLUDE to avoid spell checking virtual environment files. * 🚀 feat(megalinter.mak): add new targets to run and test megalinter locally The new targets added are: - megalinter-run: runs megalinter locally using the python flavor and beta release - megalinter-tests: runs all megalinter tests by calling megalinter-run and megalinter-build targets - megalinter-clean: removes all megalinter reports, site and megalinter_file_names_cspell.txt files to clean up the local environment. * 🔧 chore(Makefile): rename megalinter-test to megalinter-tests and add megalinter-clean target The megalinter-test target was renamed to megalinter-tests to improve consistency with the naming conventions. A new target, megalinter-clean, was added to clean the megalinter environment. * 🔨 chore(Dockerfile): update NPM_VERSION to 9.7.1 The NPM_VERSION variable has been updated to 9.7.1 to ensure that the latest version of npm is used in the Gitpod workspace. * 🎨 style(CONTRIBUTING.md): remove unnecessary link reference The link reference for [pulls] was removed as it was not being used in the document. * 🔍 chore(.cspell.json): add "ungit" and "UNGIT" to the dictionary 🔍 chore(.cspell.json): add "dearmor" to the dictionary The words "ungit" and "UNGIT" were added to the dictionary to prevent them from being flagged as spelling errors. Similarly, "dearmor" was added to the dictionary to prevent it from being flagged as a spelling error. * 🔍 chore(.cspell.json): add "addsuffix" to the dictionary The word "addsuffix" was added to the dictionary to prevent it from being flagged as a spelling mistake. * 🐛 fix(nodejs.mak): add sudo to nodejs-clean target to allow deleting node_modules directory with root privileges The node_modules directory is deleted using the 'rm' command in the nodejs-clean target. However, if the user does not have the necessary permissions, the command will fail. Adding 'sudo' to the command allows the user to delete the directory with root privileges. * 🐛 fix(.mega-linter.yml): fix REPOSITORY_TRIVY_ARGUMENTS to skip .automation/test and .venv directories The REPOSITORY_TRIVY_ARGUMENTS configuration was updated to skip the .automation/test directory and the .venv directory. This is to ensure that the linter does not scan the test directory and the virtual environment directory, which can cause unnecessary errors and warnings. * 📈 chore(requirements.txt): update pymdown-extensions to version 10.0 This commit updates the pymdown-extensions package to version 10.0 in the dev requirements file. This update may include new features, bug fixes, or security patches. * 🔧 chore(python_version.config): update Python version to 3.11 The Python version has been updated from 3.10 to 3.11 in the .config/python_version.config file. This update was done to take advantage of the new features and improvements in Python 3.11. * 🔀 chore(gitpod.yml): change default branch name from master to main This commit updates the Gitpod workflow file to use the new default branch name "main" instead of "master". This change is made to improve inclusivity and to avoid any references to slavery. * 🔥 chore(.mega-linter.yml): remove unused SPELL_MISSPELL_FILTER_REGEX_EXCLUDE The SPELL_MISSPELL_FILTER_REGEX_EXCLUDE was not being used and was removed to simplify the configuration file. * 🐛 fix(gitpod.yml): change make bootstrap-dev to make bootstrap to match the correct target The make target was incorrect, it should be "bootstrap" instead of "bootstrap-dev". This commit fixes the target to match the correct one. * 🔧 chore(gitpod.yml): update Python version to 3.11 The Python version used in the Gitpod workflow has been updated from 3.10 to 3.11 to ensure that the latest version of Python is being used. This update ensures that the project is using the latest version of Python and can take advantage of any new features or improvements. * 🆕 chore(.python-version): add Python version 3.11.4 to project This commit adds a new file named .python-version to the project root directory. The file contains the Python version 3.11.4, which is the version of Python that will be used for this project. * 🔥 chore(python_version.config): remove python version configuration file The file .config/python_version.config was removed. It was no longer needed as the project has moved to a different version of Python. * 🐛 fix(Makefile): change python version detection to use .python-version file instead of .config/python_version.config The Makefile now uses the .python-version file to detect the python version instead of the .config/python_version.config file. This change was made to improve consistency with the naming conventions used in the project. * 🔧 chore(Dockerfile): rename python_version.config to .python-version and update reference in Dockerfile The file .config/python_version.config was renamed to .python-version to follow naming conventions. The reference to the file was updated in the Dockerfile to reflect the new name. * 🐛 fix(gitpod.yml): correct typo in job name The job name was corrected from "Run Giptod tests" to "Run Gitpod tests" to fix the typo. * 🔧 chore(python.mak): update python_launcher version to python3.11 The python_launcher variable has been updated to python3.11 to reflect the latest version of Python. This change is necessary to ensure that the correct version of Python is used when running the application. * 🔧 chore(CONTRIBUTING.md): update Python version to 3.11 The Python version required to run the project has been updated from 3.10 to 3.11 to ensure compatibility with the latest version of the language. This change was made to keep the project up-to-date with the latest software versions. * 🐛 fix(CONTRIBUTING.md): update megalinter test command to match the correct target The command to test with megalinter was incorrect and has been updated to `make megalinter-tests` to match the correct target. This will ensure that the code is properly linted and formatted before being merged into the main branch. * 🚀 chore(gitpod.yml): change Python version setup to read from .python-version file The Python version setup has been changed to read from a .python-version file instead of being hardcoded in the workflow file. This allows for easier management of the Python version used in the project. Co-authored-by: Edouard Choinière <27212526+echoix@users.noreply.github.com> * 🐛 fix(workflows): use python-version-file instead of python-version to read python version from file The python version is now read from a file named .python-version instead of being hardcoded in the workflow files. This improves consistency and makes it easier to manage the python version across different workflows. Co-authored-by: Edouard Choinière <27212526+echoix@users.noreply.github.com> * 🔄 chore(.python-version): add newline at end of file This commit adds a newline at the end of the .python-version file to improve consistency with the project's coding style. * 🐛 fix(Dockerfile): add newline at end of file The commit fixes a minor issue where there was no newline at the end of the Dockerfile. * 🔥 chore(.dockerignore): add newline at end of file The commit fixes a minor issue where there was no newline at the end * 🔥 chore(gitpod.mak): add newline at end of file The commit fixes a minor issue where there was no newline at the end * 🔥 chore(help.mak): add newline at end of file The commit fixes a minor issue where there was no newline at the end * 🔥 chore(megalinter.mak): add newline at end of file The commit fixes a minor issue where there was no newline at the end * 🔥 chore(nodejs.mak): add newline at end of file The commit fixes a minor issue where there was no newline at the end * 🔥 chore(python.mak): add newline at end of file The commit fixes a minor issue where there was no newline at the end * 🔥 chore(Makefile): add newline at end of file The commit fixes a minor issue where there was no newline at the end * 🔧 chore(gitpod.mak): rename docker image tag to megalinter_gitpod:local The docker image tag has been renamed to megalinter_gitpod:local to better reflect the purpose of the image. * 🐛 fix(gitpod.mak): reorder gitpod-tests dependencies to fix build order The gitpod-tests target was not building the application before running the linting command. This commit fixes the build order by moving the gitpod-build target to be a dependency of the gitpod-tests target. * 🔧 chore(.gitignore): ignore Redis dump files and server files Added '**/dump.rdb' and 'server/server-files/' to .gitignore to prevent accidental commit of Redis database dumps and server files. This is important to avoid exposing sensitive data and to keep the repository clean from unnecessary files. --------- Co-authored-by: Edouard Choinière <27212526+echoix@users.noreply.github.com>
- Loading branch information