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

feat: Adds seedability to schools, post categoeries, report types, and feedback types #158

Merged
merged 9 commits into from
Aug 28, 2023

Conversation

TalentedB
Copy link
Contributor

Features

Adds automatic seeding for
schools
post_catergories
report_types
feedback_types

can be done through one of the following commands
go run ./scripts/main.go --seed-all # Seed every seedable table

go run ./scripts/main.go --seed-schools # Seed schools
go run ./scripts/main.go --seed-feedback-types # Seed feedback types
go run ./scripts/main.go --seed-report-types # Seed Report Types
go run ./scripts/main.go --seed-post-categories # Seed post categories

Notes

Closes #150

Copy link
Contributor Author

@TalentedB TalentedB left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

export MASK_SECRET="" # Found in Env

go run ./scripts/main.go --seed-all # Seed every seedable table

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good Code


ALTER TABLE schools
DROP CONSTRAINT unique_school_names;

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good Constraints

scripts/main.go Outdated
os.Exit(0)
}
}

func seed_all() {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an amazing feature

@gitguardian
Copy link

gitguardian bot commented Aug 27, 2023

⚠️ GitGuardian has uncovered 58 secrets following the scan of your pull request.

Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.

🔎 Detected hardcoded secrets in your pull request
GitGuardian id Secret Commit Filename
6793264 Generic High Entropy Secret bfbc4a4 features/auth/requests.http View secret
6793264 Generic High Entropy Secret bfbc4a4 features/user/requests.http View secret
6793264 Generic High Entropy Secret 5345389 features/user/requests.http View secret
6793264 Generic High Entropy Secret 5345389 features/auth/requests.http View secret
6793264 Generic High Entropy Secret d8d21b8 features/user/requests.http View secret
6793264 Generic High Entropy Secret d8d21b8 features/auth/requests.http View secret
7272655 Generic High Entropy Secret bfbc4a4 features/notifications/requests.http View secret
7272655 Generic High Entropy Secret 5345389 features/notifications/requests.http View secret
7272655 Generic High Entropy Secret d8d21b8 features/notifications/requests.http View secret
7355027 Generic High Entropy Secret bfbc4a4 features/notifications/requests.http View secret
7355027 Generic High Entropy Secret 5345389 features/notifications/requests.http View secret
7355027 Generic High Entropy Secret d8d21b8 features/notifications/requests.http View secret
7771818 Bearer Token bfbc4a4 features/drafts/requests.http View secret
7771818 Bearer Token bfbc4a4 features/votes/requests.http View secret
7771818 Bearer Token bfbc4a4 features/auth/requests.http View secret
7771818 Bearer Token bfbc4a4 features/reports/requests.http View secret
7771818 Bearer Token bfbc4a4 features/feedback/requests.http View secret
7771818 Bearer Token bfbc4a4 features/notifications/requests.http View secret
7771818 Bearer Token bfbc4a4 features/posts/requests.http View secret
7771818 Bearer Token bfbc4a4 features/comments/requests.http View secret
7771818 Bearer Token bfbc4a4 features/user/requests.http View secret
7771818 Bearer Token bfbc4a4 features/saves/requests.http View secret
7771818 Bearer Token bfbc4a4 features/schools/requests.http View secret
7771818 Bearer Token bfbc4a4 features/notifications/requests.http View secret
7771818 Bearer Token bfbc4a4 features/posts/requests.http View secret
7771818 Bearer Token bfbc4a4 features/admin/requests.http View secret
7771818 Bearer Token bfbc4a4 features/hide_log/requests.http View secret
7771818 Bearer Token bfbc4a4 features/notifications/requests.http View secret
7907134 Bearer Token 5345389 features/hide_log/requests.http View secret
7907134 Bearer Token 5345389 features/auth/requests.http View secret
7907134 Bearer Token 5345389 features/notifications/requests.http View secret
7907134 Bearer Token 5345389 features/saves/requests.http View secret
7907134 Bearer Token 5345389 features/comments/requests.http View secret
7907134 Bearer Token 5345389 features/posts/requests.http View secret
7907134 Bearer Token 5345389 features/schools/requests.http View secret
7907134 Bearer Token 5345389 features/admin/requests.http View secret
7907134 Bearer Token 5345389 features/notifications/requests.http View secret
7907134 Bearer Token 5345389 features/reports/requests.http View secret
7907134 Bearer Token 5345389 features/drafts/requests.http View secret
7907134 Bearer Token 5345389 features/user/requests.http View secret
7907134 Bearer Token 5345389 features/feedback/requests.http View secret
7907134 Bearer Token 5345389 features/notifications/requests.http View secret
7907134 Bearer Token 5345389 features/votes/requests.http View secret
7907134 Bearer Token d8d21b8 features/notifications/requests.http View secret
7907134 Bearer Token d8d21b8 features/notifications/requests.http View secret
7907134 Bearer Token d8d21b8 features/hide_log/requests.http View secret
7907134 Bearer Token d8d21b8 features/comments/requests.http View secret
7907134 Bearer Token d8d21b8 features/schools/requests.http View secret
7907134 Bearer Token d8d21b8 features/drafts/requests.http View secret
7907134 Bearer Token d8d21b8 features/feedback/requests.http View secret
7907134 Bearer Token d8d21b8 features/admin/requests.http View secret
7907134 Bearer Token d8d21b8 features/auth/requests.http View secret
7907134 Bearer Token d8d21b8 features/saves/requests.http View secret
7907134 Bearer Token d8d21b8 features/user/requests.http View secret
7907134 Bearer Token d8d21b8 features/votes/requests.http View secret
7907134 Bearer Token d8d21b8 features/notifications/requests.http View secret
7907134 Bearer Token d8d21b8 features/reports/requests.http View secret
7907134 Bearer Token d8d21b8 features/posts/requests.http View secret
🛠 Guidelines to remediate hardcoded secrets
  1. Understand the implications of revoking this secret by investigating where it is used in your code.
  2. Replace and store your secrets safely. Learn here the best practices.
  3. Revoke and rotate these secrets.
  4. If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.

To avoid such incidents in the future consider


🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

Our GitHub checks need improvements? Share your feedbacks!

Copy link
Member

@mattrltrent mattrltrent left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! I fixed an error where some seeds had duplicates and added seed sets for faculties and years of study. Merging now!

@mattrltrent mattrltrent merged commit 0776f6f into main Aug 28, 2023
1 of 2 checks passed
@mattrltrent mattrltrent deleted the seeding_database branch August 28, 2023 00:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants