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

New user role entity #20

Merged
merged 97 commits into from
Dec 4, 2024
Merged

New user role entity #20

merged 97 commits into from
Dec 4, 2024

Conversation

tsviz
Copy link
Contributor

@tsviz tsviz commented Nov 13, 2024

This pull request introduces multiple changes aimed at improving the development environment, refining the CI/CD workflows, and enhancing the database schema. The most important changes include the addition of a development container configuration, modifications to the GitHub Actions workflows, and updates to the database context and migrations.

Development Environment:

  • Added a new development container configuration in .devcontainer/devcontainer.json to streamline the setup process for the RazorPagesMovie project. This includes specifying the Docker image, port forwarding, and VS Code customizations.

CI/CD Workflows:

  • Renamed the staging-end2end-tests job to qa-functional-UI-tests and updated its permissions and environment configuration in .github/workflows/cd.yml.
  • Enhanced the qa-functional-UI-tests job to include telemetry data gathering and running UI automated Selenium tests.
  • Updated the production job to depend on qa-functional-UI-tests and added a condition to run only on the main branch.
  • Removed the push trigger for the CI workflow and adjusted the condition for running the build-and-publish-docker-image job to only on pull requests to the main branch. [1] [2]

Database Schema:

  • Updated the RazorPagesMovieContext to include a Users DbSet and added configurations for User and Movie entities, including seeding initial data with hashed passwords.
  • Removed outdated migration files to clean up the project. [1] [2] [3] [4] [5]

…just column types, and enhance validation attributes
… default values and update nullability for Movie property in edit model
…ty: update login process to store user role, modify movie index page to show actions based on role, and create add to favorites page and logic
@tsviz tsviz requested a review from Copilot November 13, 2024 18:47
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 20 out of 35 changed files in this pull request and generated 3 suggestions.

Files not reviewed (15)
  • Migrations/20240613200303_InitialCreate.Designer.cs: Language not supported
  • Migrations/20240623214222_Rating.Designer.cs: Language not supported
  • Migrations/20240623215214_RatingTwo.Designer.cs: Language not supported
  • Migrations/20241112044546_InitialCreate.Designer.cs: Language not supported
  • Pages/Account/Login.cshtml: Evaluated as low risk
  • Migrations/20240613200303_InitialCreate.cs: Evaluated as low risk
  • Migrations/RazorPagesMovieContextModelSnapshot.cs: Evaluated as low risk
  • Migrations/20240623215214_RatingTwo.cs: Evaluated as low risk
  • Migrations/20240623214222_Rating.cs: Evaluated as low risk
  • Pages/Account/Logout.cshtml: Evaluated as low risk
  • Models/SeedData.cs: Evaluated as low risk
  • .github/workflows/ci.yml: Evaluated as low risk
  • .github/workflows/cd.yml: Evaluated as low risk
  • Data/RazorPagesMovieContext.cs: Evaluated as low risk
  • Migrations/20241112044546_InitialCreate.cs: Evaluated as low risk

Tip: Leave feedback on Copilot's review comments with the 👎 and 👍 buttons to help improve review quality. Learn more

Pages/Account/Login.cshtml.cs Outdated Show resolved Hide resolved
var role = user.Role.ToString();

// Log user role to console
Console.WriteLine($"User {user.Username} logged in at {DateTime.UtcNow} with role: {role}");
Copy link
Preview

Copilot AI Nov 13, 2024

Choose a reason for hiding this comment

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

Using Console.WriteLine for logging is not recommended in production code. Use the logger instead.

Suggested change
Console.WriteLine($"User {user.Username} logged in at {DateTime.UtcNow} with role: {role}");

Copilot is powered by AI, so mistakes are possible. Review output carefully before use.

Positive Feedback
Negative Feedback

Provide additional feedback

Please help us improve GitHub Copilot by sharing more details about this comment.

Please select one or more of the options
Models/Movie.cs Outdated
// </snippet1>
#endif
[Timestamp]
public byte[] Timestamp { get; set; } = new byte[8]; // Initialize with a default value
Copy link
Preview

Copilot AI Nov 13, 2024

Choose a reason for hiding this comment

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

The Timestamp property should not be initialized with a default value in the model. This should be handled by the database.

Suggested change
public byte[] Timestamp { get; set; } = new byte[8]; // Initialize with a default value
[Timestamp]
public byte[] Timestamp { get; set; }

Copilot is powered by AI, so mistakes are possible. Review output carefully before use.

Positive Feedback
Negative Feedback

Provide additional feedback

Please help us improve GitHub Copilot by sharing more details about this comment.

Please select one or more of the options
@tsviz tsviz changed the title Develop New User Role entity. Nov 14, 2024
@tsviz tsviz changed the title New User Role entity. New user role entity Nov 14, 2024
…djust dependencies for QA environment provisioning
…ests and update CI workflow to support multiple test users
… setup for macOS and Windows to streamline test user configuration
…S and Windows to randomize test user credentials
…nd Windows to define specific test user credentials
…for macOS and Windows to allow server to receive requests
…iable setup for macOS and Windows to optimize request handling
…setup for Windows to ensure server readiness for requests
…ingle job and remove redundant environment variable setup
@tsviz tsviz merged commit 15f7f02 into main Dec 4, 2024
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant