Skip to content

Fullstackopen course#7

Merged
Mr-Fred merged 472 commits into
mainfrom
fullstackopen_course
Jul 22, 2025
Merged

Fullstackopen course#7
Mr-Fred merged 472 commits into
mainfrom
fullstackopen_course

Conversation

@Mr-Fred

@Mr-Fred Mr-Fred commented Jul 19, 2025

Copy link
Copy Markdown
Owner

Updating the main branch to use it for exercise "11.20 Your own pipeline" of fullstackopen Course

kentcdodds and others added 30 commits December 11, 2020 11:40
* docs: update README.md [skip ci]

* docs: update .all-contributorsrc [skip ci]

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
The word version was added by mistake.
Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
to give more context for `<script type="module">`
* docs: update README.md [skip ci]

* docs: update .all-contributorsrc [skip ci]

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
* docs: update README.md [skip ci]

* docs: update .all-contributorsrc [skip ci]

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
Mr-Fred and others added 29 commits December 24, 2024 04:08
part6-c Communicating with server in a Redux application
Exercises 6.16.-6.19.
Managing data on the server with the React Query library
Part6-d Exercises 6.20.-6.22.
… for managing notifications

Part6-d Exercises 6.23.-6.24.
pat7-b Exercises 7.4.-7.8.
…to use reducers and hooks, and integrate Bootstrap
…ication system

Part 7-f extending blogList App Exercises 7.9.-7.21
…or phonebook and library applications

Part 8-b Exercises 8.8.-8.12
…oDB connection and update environment variables

Part 8-c Database and user administration
Exercises 8.13.-8.16
…tration and login mutations; implement authentication in Apollo Client; enhance error handling; create new components for user registration and genre filtering

Part8-d Exercises 8.17.-8.22
…implement cache update helpers and subscriptions for real-time updates

Part 8-e Exercises 8.23.-8.26
This commit introduces end-to-end testing with Playwright and sets up a complete CI/CD pipeline for automated deployment to Google Cloud Run.

Key changes include:

**E2E Testing with Playwright:**
- Adds a new suite of E2E tests (`note_app.spec.js`) to verify core application functionality, including user login and note creation.
- Implements a dedicated testing API endpoint (`/api/testing/reset`) to ensure a clean database state before each test run.
- Includes helper functions (`tests/helper.js`) to streamline common test actions like logging in and creating notes.

**CI/CD and Deployment:**
- Configures a GitHub Actions workflow (`deploy_note_app.yml`) to build, test, and deploy the application.
- The workflow runs linting and E2E tests on pull requests and deploys to Cloud Run on pushes to the `fullstackopen_course` branch.
- Adds Terraform configuration (`terraform/`) to provision all necessary Google Cloud resources, including Artifact Registry, Cloud Run, Service Accounts, and Workload Identity Federation for secure, passwordless authentication from GitHub Actions.

**Fixes & Chores:**
- Resolves the Mongoose `OverwriteModelError` by ensuring models are only compiled once.
- Fixes various npm dependency conflicts by aligning ESLint versions.
- Updates `package.json` scripts to reflect the new testing and development workflow.
The `build-and-deploy` job was failing with a "file not found" error during the `docker build` step. This was caused by the `working-directory` being set to a subdirectory, which resulted in an incorrect Docker build context.

The Dockerfile requires access to files across multiple directories (`part2/notes_frontend` and `part3/notes_fullstack`) from the repository root.

This commit resolves the issue by:
- Removing the `working-directory` from the build step to use the repository root as the build context.
- Adding the `-f` flag to the `docker build` command to explicitly specify the path to the Dockerfile.

This ensures the Docker daemon has access to all necessary source files, allowing the multi-stage build to complete successfully.
The `build-and-test` job was failing due to two issues in the backend's linting setup.

First, a peer dependency conflict existed between `eslint-config-airbnb` and `eslint-plugin-react-hooks`. The Airbnb config required version `^4.3.0` of the hooks plugin, while the project specified `^5.0.0`, causing an `ERESOLVE` error during `npm ci`.

Second, the ESLint flat config (`eslint.config.mjs`) was invalid. It contained rules outside of the `rules` object and used an `extends` property, which is not supported in the new format.

This commit resolves these problems by:
- Downgrading `eslint-plugin-react-hooks` to a compatible version (`4.6.2`) in `package.json`.
- Restructuring `eslint.config.mjs` to be a valid flat configuration.
- Updating the `package-lock.json` to reflect the dependency changes.

These changes ensure the linting dependencies are correctly resolved and the configuration is valid, allowing the CI pipeline to proceed.
This commit addresses several linting violations in the Playwright test file `note_app.spec.js`.

The changes align the test code with the project's established ESLint rules, including adjustments for indentation, spacing, and quote style.

Correcting these issues improves code consistency and readability, making the test suite easier to maintain. No functional logic has been altered.
…g in notes API

refactor: Update note creation to use async/await and improve error messaging
style: Adjust ESLint configuration to ignore specific directories
test: Fix test helper paths and update test scripts in package.json
chore: Add dotenv configuration for environment variables
@Mr-Fred
Mr-Fred merged commit 57b24dd into main Jul 22, 2025
2 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.