guibranco / gstraccini-bot

πŸ€– :octocat: GStraccini-bot automates repository management, ensuring organization and health by handling pull requests, issues, comments, and commits.
https://bot.straccini.com
MIT License
2 stars 0 forks source link

GitAuto: [FEATURE] Rename table `github_pull_requests_comments` to `github_comments` #485

Closed gitauto-ai[bot] closed 2 weeks ago

gitauto-ai[bot] commented 2 weeks ago

Original issue: #483

What is the feature

The feature involves renaming the database table github_pull_requests_comments to github_comments.

Why we need the feature

Renaming the table to github_comments provides a more generalized and concise naming convention. This change will make the table name more intuitive and reflective of its purpose, which is to store comments related to GitHub, not just pull requests.

How to implement and why

  1. Create a SQL Migration File:

    • Add a new SQL file in the Sql directory to rename the table. The SQL command will be RENAME TABLE github_pull_requests_comments TO github_comments;. This ensures that the database schema is updated consistently across all environments.
  2. Update PHP Code:

    • Modify the table name in Src/lib/bot.database.php at line 444. This change is necessary to ensure that the application code references the new table name, preventing any runtime errors related to database operations.
  3. Update Shell Script:

    • Change the table name in Tests/db-integrity.sh at line 37. This update is crucial for maintaining the integrity checks and ensuring that the scripts align with the new database schema.

About backward compatibility

This change is not backward compatible as it involves renaming a database table. Any existing scripts, queries, or code that reference the old table name will need to be updated to prevent failures. It is important to communicate this change to all stakeholders and ensure that all dependent systems are updated accordingly.

Test these changes locally

git checkout -b gitauto/issue-#483-a9aea50b-e547-4c70-937d-147268bfdc51
git pull origin gitauto/issue-#483-a9aea50b-e547-4c70-937d-147268bfdc51
deepsource-io[bot] commented 2 weeks ago

Here's the code health analysis summary for commits ff4abf6..0eb9cb7. View details on DeepSource β†—.

Analysis Summary

AnalyzerStatusSummaryLink
DeepSource Docker LogoDockerβœ… SuccessView Check β†—
DeepSource PHP LogoPHPβœ… SuccessView Check β†—
DeepSource Secrets LogoSecretsβœ… SuccessView Check β†—
DeepSource SQL LogoSQLβœ… SuccessView Check β†—

πŸ’‘ If you’re a repository administrator, you can configure the quality gates from the settings.
sonarcloud[bot] commented 2 weeks ago

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud

github-actions[bot] commented 2 weeks ago

Infisical secrets check: :white_check_mark: No secrets leaked!

Scan results:

11:34PM INF scanning for exposed secrets...
11:34PM INF 422 commits scanned.
11:34PM INF scan completed in 128ms
11:34PM INF no leaks found