In software engineering, effective commit messages are crucial for maintaining a clear project history, facilitating collaboration, and improving codebase management. However, students in capstone projects often struggle with crafting meaningful commit messages. To address this, we propose leveraging Generative AI to enhance the quality of commit messages. This approach involves analyzing code changes and offering three possible commit message options, along with the flexibility for students to create their own messages based on the suggestions.
- letscommit-past-inv
- Table of Contents
- Problem
- Solution
- Version
- Dependencies
- Commit API Server - User Guide
- Let's Commit - User Guide
- Getting Started with Create React App
- Support
- References
- License
Students often struggle with writing clear and concise commit messages, which can lead to poorly documented project histories.
letscommit
uses Generative AI to analyze code changes and provide three commit message suggestions. For example, if a student makes changes to improve the performance of a function, the tool might suggest:
- "Optimize function for better performance."
- "Refactor code to enhance efficiency."
- "Improve function execution time."
Students can choose one of these suggestions or use them as a basis to craft their own commit message.
Current system version: 1.0.0
Before installing and running, make sure you have the following requirements installed:
- Python 3.6+
requests
module- Node.js (version 12 or higher)
- Git
- Npm
- React
- Postgresql
This is the backend server, responsible for handling API requests, managing data, and serving responses to the frontend application.
Clone the project repository:
git clone https://github.com/iic2154-uc-cl/letscommit-past-inv
Navigate to the server directory and run the following command to install the dependencies:
cd letscommit-past-inv/server
npm install
Create a .env
file in the root directory of the server and set up the necessary environment variables. An example of a .env
file might look like this:
DB_HOST=your_db_host
DB_USER=your_db_user
DB_PASS=your_db_password
DB_NAME=your_db_name
JWT_SECRET=your_jwt_secret
PORT=your_port
To run the server in development mode, use the following command:
npm start
To prepare and run the server in production, follow these steps:
- Ensure all environment variables are set in the
.env
file. - Start the server using a process manager like pm2:
The letscommit
module is designed to simplify the process of generating and committing changes to your Git repository with automatically generated commit messages. This guide will walk you through the installation, configuration, and usage of the module.
Before installing the letscommit
module, make sure you have the following requirements installed:
- Python 3.6 or higher
- Python
requests
module - Git
To install the letscommit
module, follow these steps:
-
Clone the repository:
git clone https://github.com/iic2154-uc-cl/letscommit-past-inv.git
-
Declare your api url in main.py:
API_URL =
-
Build the distribution package:
cd letscommit-past-inv/cmd-cli python setup.py sdist
-
Install the generated package:
pip install dist/letscommit-1.0.7.tar.gz
- Log In or Register:
Before using the letscommit
module, you need to log in or register for an account:
-
To log in, use the command:
letscommit --login
-
To register and create a new account, use the command:
-
letscommit --signup
- Verify the Token:
To check if your token is valid, run the following command:
letscommit --check
Now that you are set up, you can start generating commits using the letscommit
module.
- Add Changes:
Before generating a commit, make sure to add the changes you want to commit using the git add
command:
git add archivo1 archivo2
- Initiate Auto Commit:
To automatically generate and commit changes, use the following command:
letscommit --start
The module will perform the following steps:
- Retrieve changes from your Git repository.
- Generate a list of commit messages.
- Allow you to select a commit message from the list or provide a custom one.
- Create a commit with the chosen message.
- Push Changes:
After generating the commit, make sure to push your changes to the remote repository using the git push
command:
git push origin nombre_de_rama
The module will present you with a list of generated commit messages. You can choose one of the following options:
- Enter
0
to provide a commit message. - Enter the number corresponding to one of the generated commit messages.
-
If you encounter any issues or need help, you can use the
--help
option to see available options and usage examples:letscommit --help
This project was bootstrapped with Create React App.
In the project directory, you can run:
Runs the app in the development mode.
Open http://localhost:3000 to view it in your browser.
The page will reload when you make changes.
You may also see any lint errors in the console.
Launches the test runner in the interactive watch mode.
See the section about running tests for more information.
Builds the app for production to the build
folder.
It correctly bundles React in production mode and optimizes the build for the best performance.
The build is minified and the filenames include the hashes.
Your app is ready to be deployed!
See the section about deployment for more information.
Note: this is a one-way operation. Once you eject
, you can't go back!
If you aren't satisfied with the build tool and configuration choices, you can eject
at any time. This command will remove the single build dependency from your project.
Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except eject
will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.
You don't have to ever use eject
. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.
You can learn more in the Create React App documentation.
To learn React, check out the React documentation.
This section has moved here: https://facebook.github.io/create-react-app/docs/code-splitting
This section has moved here: https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size
This section has moved here: https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app
This section has moved here: https://facebook.github.io/create-react-app/docs/advanced-configuration
This section has moved here: https://facebook.github.io/create-react-app/docs/deployment
This section has moved here: https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify
For support, please contact us at aneyem@uc.cl
- SEIS-Lab: http://www.seislab.cl/
This project is licensed under the ISC License. See the LICENSE file for details.
Code last updated: January 13, 2024