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

Updated operation documentation #3475

Merged
merged 3 commits into from
Jan 28, 2025

Conversation

palisadoes
Copy link
Contributor

@palisadoes palisadoes commented Jan 28, 2025

What kind of change does this PR introduce?

Updated operation documentation

Issue Number:

  • N/A

Snapshots/Videos:

  • N/A

If relevant, did you update the documentation?

  • N/A

Summary

Updated operation documentation explaining how to login

Does this PR introduce a breaking change?

  • No

Other information

  • N/A

Have you read the contributing guide?

  • Yes

Summary by CodeRabbit

  • Documentation
    • Added new developer resources documentation:
      • Introduction guide
      • Operation and login instructions
      • Testing guidelines
      • Troubleshooting section
    • Updated sidebar configuration to reorganize developer resources
    • Removed post-configuration steps from installation guide
    • Updated dependency versions for enhanced flexibility in management
    • Added metadata for package manager in project configuration

@palisadoes palisadoes added the ignore-sensitive-files-pr The contributor has a legitimate reason for editiing protected files label Jan 28, 2025
Copy link
Contributor

coderabbitai bot commented Jan 28, 2025

Walkthrough

This pull request introduces new documentation for the Talawa-Admin project, focusing on developer resources and getting started guides. Several markdown files have been added in the docs/docs/docs/ directory, covering topics such as introduction, operation, testing, and troubleshooting. The sidebar configuration has been updated to reflect these new sections, reorganizing the "Plugins" category into "Developer Resources." Additionally, the package.json files have been modified to enhance dependency management and provide package manager information.

Changes

File Change Summary
docs/docs/docs/developer-resources/introduction.md New documentation file with metadata and welcome message
docs/docs/docs/developer-resources/operation.md New documentation file with "Coming soon" placeholder
docs/docs/docs/developer-resources/testing.md Comprehensive testing guidelines including test running, debugging, and Git hooks
docs/docs/docs/developer-resources/troubleshooting.md New troubleshooting documentation with placeholder content
docs/docs/docs/getting-started/installation.md Removed post-configuration steps and testing instructions
docs/docs/docs/getting-started/operation.md New file detailing application operation, registration, and login processes
docs/sidebars.ts Renamed "Plugins" category to "Developer Resources"
docs/package.json Updated dependency versions for flexibility in management
package.json Added new property for package manager information

Sequence Diagram

sequenceDiagram
    participant Developer
    participant TalawaAdmin
    participant LocalServer
    
    Developer->>TalawaAdmin: Run npm run serve
    TalawaAdmin->>LocalServer: Start server on port 4321
    Developer->>LocalServer: Access http://localhost:4321/
    Developer->>TalawaAdmin: Register new account
    Developer->>TalawaAdmin: Login with credentials
Loading

Possibly related PRs

Poem

🐰 Docs unfurl like rabbit ears tall,
Developer guides standing proud and small
From testing to login, we've mapped the way
Talawa's knowledge blooms bright today!
Code rabbits hop through documentation's light 🌟


📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4478b20 and e139a62.

📒 Files selected for processing (4)
  • docs/docs/docs/developer-resources/introduction.md (1 hunks)
  • docs/docs/docs/developer-resources/troubleshooting.md (1 hunks)
  • docs/package.json (2 hunks)
  • package.json (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • package.json
🚧 Files skipped from review as they are similar to previous changes (2)
  • docs/docs/docs/developer-resources/troubleshooting.md
  • docs/docs/docs/developer-resources/introduction.md
⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: Test Application
  • GitHub Check: Analyse Code With CodeQL (javascript)
🔇 Additional comments (3)
docs/package.json (3)

Line range hint 1-47: Clarify the scope of package updates.

The PR objectives mention updating only the login documentation, but these changes to the documentation build system seem broader in scope. Could you please clarify if these dependency updates are necessary for the login documentation changes?


18-19: Verify Docusaurus version compatibility.

The update from 3.6.3 to ^3.7.0 for all Docusaurus packages is a significant version jump that could affect documentation generation. While using caret (^) notation provides flexibility for minor updates, we should ensure compatibility.

Also applies to: 28-30

✅ Verification successful

✅ Docusaurus version update is safe to proceed

The update from 3.6.3 to 3.7.0 brings improvements like better build performance and bug fixes, with no breaking changes. The version bump follows semver and is safe for documentation generation.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check Docusaurus changelog and releases for breaking changes
curl -s "https://api.github.com/repos/facebook/docusaurus/releases" | jq -r '.[] | select(.tag_name | startswith("v3.")) | {tag_name, body}' | head -n 10

# Verify if the project builds with the new versions
echo "Note: Actual build verification should be done in CI pipeline"

Length of output: 7804


Line range hint 1-47: Request yarn.lock update.

The package.json changes should be accompanied by corresponding updates to the yarn.lock file to ensure consistent dependency resolution across environments.

Please ensure the yarn.lock file is updated by running:


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

Our Pull Request Approval Process

Thanks for contributing!

Testing Your Code

Remember, your PRs won't be reviewed until these criteria are met:

  1. We don't merge PRs with poor code quality.
    1. Follow coding best practices such that CodeRabbit.ai approves your PR.
  2. We don't merge PRs with failed tests.
    1. When tests fail, click on the Details link to learn more.
    2. Write sufficient tests for your changes (CodeCov Patch Test). Your testing level must be better than the target threshold of the repository
    3. Tests may fail if you edit sensitive files. Ask to add the ignore-sensitive-files-pr label if the edits are necessary.
  3. We cannot merge PRs with conflicting files. These must be fixed.

Our policies make our code better.

Reviewers

Do not assign reviewers. Our Queue Monitors will review your PR and assign them.
When your PR has been assigned reviewers contact them to get your code reviewed and approved via:

  1. comments in this PR or
  2. our slack channel

Reviewing Your Code

Your reviewer(s) will have the following roles:

  1. arbitrators of future discussions with other contributors about the validity of your changes
  2. point of contact for evaluating the validity of your work
  3. person who verifies matching issues by others that should be closed.
  4. person who gives general guidance in fixing your tests

CONTRIBUTING.md

Read our CONTRIBUTING.md file. Most importantly:

  1. PRs with issues not assigned to you will be closed by the reviewer
  2. Fix the first comment in the PR so that each issue listed automatically closes

Other

  1. 🎯 Please be considerate of our volunteers' time. Contacting the person who assigned the reviewers is not advised unless they ask for your input. Do not @ the person who did the assignment otherwise.
  2. Read the CONTRIBUTING.md file make

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (11)
docs/docs/docs/getting-started/operation.md (5)

8-8: Improve grammar in the introduction.

The sentence contains a split infinitive. Consider rewording for better clarity and professionalism.

-This page outlines how to successfully operate the application
+This page outlines how to operate the application successfully
🧰 Tools
🪛 LanguageTool

[style] ~8-~8: Style-wise, it’s not ideal to insert an adverb (‘successfully’) in the middle of an infinitive construction (‘to operate’). Try moving the adverb to avoid split infinitives.
Context: ...position: 2 --- This page outlines how to successfully operate the application ## Operation Operation of the applica...

(SPLIT_INFINITIVE)


25-25: Add missing comma for better readability.

-By default `talawa-admin` runs on port `4321` on your system's localhost.
+By default, `talawa-admin` runs on port `4321` on your system's localhost.

37-41: Clarify the placeholder syntax usage.

The {{customPort}} syntax might be confusing for users unfamiliar with template placeholders. Consider adding a brief explanation or using a more explicit example.

-http://localhost:{{customPort}}/
+http://localhost:PORT_NUMBER/

-Replace `{{customPort}}` with the actual custom port number you have configured in your `.env` file.
+Replace `PORT_NUMBER` with the actual port number you have configured in your `.env` file (e.g., http://localhost:3000/).

45-45: Improve the registration section structure and clarity.

The current paragraph is a run-on sentence and lacks specific details about the registration process.

-The first time you navigate to the running talawa-admin's website you'll land at talawa-admin registration page. Sign up using whatever credentials you want and create the account. Make sure to remember the email and password you entered because they'll be used to sign you in later on.
+When you first navigate to the running Talawa-Admin website, you'll land on the registration page. Follow these steps to create your account:
+
+1. Fill in your email address
+2. Choose a secure password
+3. Complete any additional required fields
+4. Click the "Sign Up" button to create your account
+
+**Note:** Remember your email and password as they will be required for future logins.

57-58: Fix grammar and improve clarity of API environment variables.

-The email address and password are defined these API environment variables:
+The email address and password are defined by the following API environment variables:
🧰 Tools
🪛 LanguageTool

[uncategorized] ~57-~57: Possible missing preposition found.
Context: ... email address and password are defined these API environment variables: 1. `API_ADM...

(AI_EN_LECTOR_MISSING_PREPOSITION)

docs/docs/docs/developer-resources/testing.md (6)

8-10: Enhance the introduction with more context.

The introduction could be more informative by including:

  • Types of tests supported (unit, integration, e2e)
  • Testing framework used (Jest, React Testing Library)
  • Overview of project's testing strategy and requirements
 ## Introduction
 
-It is important to test our code. If you are a contributor, please follow these steps.
+Talawa Admin uses Jest and React Testing Library for testing. As a contributor, you should:
+
+- Write unit tests for new components and utilities
+- Ensure integration tests cover component interactions
+- Maintain minimum 80% test coverage
+- Follow the testing guidelines below

12-19: Add more details about test execution and requirements.

Consider expanding this section with:

  • Test coverage requirements and how to check coverage
  • Explanation of test output and how to interpret results
  • Guidelines for writing new tests
 ### Running tests
 
 You can run the tests for `talawa-admin` using this command:
 
 ```bash
 npm run test

+To check test coverage:
+bash +npm run test:coverage +
+
+The coverage report will show:
+- Statements coverage (minimum 80% required)
+- Branch coverage
+- Function coverage
+- Line coverage
+
+### Writing Tests
+
+When writing new tests:
+1. Place test files next to the component being tested
+2. Name test files with .test.tsx extension
+3. Follow the AAA pattern (Arrange, Act, Assert)
+4. Mock external dependencies appropriately


---

`23-23`: **Fix typo in the word "browser".**

There's a typo in the word "broswer".

```diff
-You can see the output of failing tests in broswer by running `jest-preview` package before running your tests
+You can see the output of failing tests in browser by running `jest-preview` package before running your tests

35-41: Expand the linting documentation.

The linting section could be more comprehensive by including:

  • Available linting rules and their purpose
  • How to configure linting rules
  • How to handle and fix common linting errors
 ### Linting code files
 
 You can lint your code files using this command:
 
 ```bash
 npm run lint:fix

+We use ESLint with the following configurations:
+- React recommended rules
+- TypeScript recommended rules
+- Custom project rules
+
+To check linting without fixing:
+bash +npm run lint +
+
+Common linting errors and how to fix them:
+1. Import ordering
+2. Unused variables
+3. Missing type annotations


<details>
<summary>🧰 Tools</summary>

<details>
<summary>🪛 LanguageTool</summary>

[grammar] ~37-~37: The word ‘lint’ is a noun or an adjective. A verb or adverb is missing or misspelled here, or maybe a comma is missing.
Context: ....webp)  ### Linting code files  You can lint your code files using this command:  ``...

(PRP_MD_NN)

</details>

</details>

---

`59-59`: **Fix typo in "package.json".**

There's a typo in the word "pakage.json".

```diff
-We are also running a post-merge(post-pull) hook which will automatically run "npm install" only if there is any change made to pakage.json file so that the developer has all the required dependencies when pulling files from remote.
+We are also running a post-merge(post-pull) hook which will automatically run "npm install" only if there is any change made to package.json file so that the developer has all the required dependencies when pulling files from remote.

49-49: List the specific checks performed by the pre-commit hook.

The documentation should specify which code quality checks are performed by the pre-commit hook.

-We run a pre-commit hook which automatically runs code quality checks each time you make a commit and also fixes some of the issues. This way you don't have to run them manually each time.
+We run a pre-commit hook which automatically performs the following checks:
+1. ESLint for code style and potential errors
+2. Prettier for code formatting
+3. TypeScript compilation
+4. Unit tests in changed files
+
+These checks help maintain code quality and catch issues early. Failed checks will prevent the commit, but some issues can be automatically fixed.
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3c85403 and 4478b20.

📒 Files selected for processing (7)
  • docs/docs/docs/developer-resources/introduction.md (1 hunks)
  • docs/docs/docs/developer-resources/operation.md (1 hunks)
  • docs/docs/docs/developer-resources/testing.md (1 hunks)
  • docs/docs/docs/developer-resources/troubleshooting.md (1 hunks)
  • docs/docs/docs/getting-started/installation.md (0 hunks)
  • docs/docs/docs/getting-started/operation.md (1 hunks)
  • docs/sidebars.ts (1 hunks)
💤 Files with no reviewable changes (1)
  • docs/docs/docs/getting-started/installation.md
✅ Files skipped from review due to trivial changes (3)
  • docs/docs/docs/developer-resources/troubleshooting.md
  • docs/docs/docs/developer-resources/introduction.md
  • docs/docs/docs/developer-resources/operation.md
🧰 Additional context used
🪛 LanguageTool
docs/docs/docs/getting-started/operation.md

[style] ~8-~8: Style-wise, it’s not ideal to insert an adverb (‘successfully’) in the middle of an infinitive construction (‘to operate’). Try moving the adverb to avoid split infinitives.
Context: ...position: 2 --- This page outlines how to successfully operate the application ## Operation Operation of the applica...

(SPLIT_INFINITIVE)


[uncategorized] ~24-~24: Did you mean: “By default,”?
Context: ...serve ``` ### Accessing Talawa-Admin By default talawa-admin runs on port `4321` on y...

(BY_DEFAULT_COMMA)


[uncategorized] ~57-~57: Possible missing preposition found.
Context: ... email address and password are defined these API environment variables: 1. `API_ADM...

(AI_EN_LECTOR_MISSING_PREPOSITION)

docs/docs/docs/developer-resources/testing.md

[grammar] ~37-~37: The word ‘lint’ is a noun or an adjective. A verb or adverb is missing or misspelled here, or maybe a comma is missing.
Context: ....webp) ### Linting code files You can lint your code files using this command: ``...

(PRP_MD_NN)

⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Test Application
🔇 Additional comments (2)
docs/docs/docs/developer-resources/testing.md (2)

1-6: LGTM! Well-structured metadata.

The frontmatter contains all necessary fields and follows documentation conventions.


33-33: Verify the referenced image exists.

The documentation references an image at ../../../static/img/markdown/installation/jest-preview.webp. Please ensure this image exists in the repository.

✅ Verification successful

Image file exists at the referenced location

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check if the referenced image exists
fd -t f "jest-preview.webp" 

Length of output: 115

Comment on lines +63 to +67
In a development environment, the defaults are:

1. `API_ADMINISTRATOR_USER_EMAIL_ADDRESS`[email protected]
1. `API_ADMINISTRATOR_USER_NAME`=administrator
1. `API_ADMINISTRATOR_USER_PASSWORD`=password
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Add security warning for default credentials.

The documentation should emphasize that these are development-only credentials and should never be used in production.

 In a development environment, the defaults are:

 1. `API_ADMINISTRATOR_USER_EMAIL_ADDRESS`[email protected]
 1. `API_ADMINISTRATOR_USER_NAME`=administrator
 1. `API_ADMINISTRATOR_USER_PASSWORD`=password
+
+> **⚠️ Security Warning**: These are default credentials for development purposes only. 
+> Never use these credentials in a production environment. Always change these values
+> to secure credentials before deploying to production.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
In a development environment, the defaults are:
1. `API_ADMINISTRATOR_USER_EMAIL_ADDRESS`=[email protected]
1. `API_ADMINISTRATOR_USER_NAME`=administrator
1. `API_ADMINISTRATOR_USER_PASSWORD`=password
In a development environment, the defaults are:
1. `API_ADMINISTRATOR_USER_EMAIL_ADDRESS`=[email protected]
1. `API_ADMINISTRATOR_USER_NAME`=administrator
1. `API_ADMINISTRATOR_USER_PASSWORD`=password
> **⚠️ Security Warning**: These are default credentials for development purposes only.
> Never use these credentials in a production environment. Always change these values
> to secure credentials before deploying to production.

Copy link

codecov bot commented Jan 28, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.80%. Comparing base (73cf8cd) to head (e139a62).
Report is 9 commits behind head on develop-postgres.

Additional details and impacted files
@@                  Coverage Diff                  @@
##           develop-postgres    #3475       +/-   ##
=====================================================
+ Coverage              1.90%   88.80%   +86.89%     
=====================================================
  Files                   316      338       +22     
  Lines                  8249     8626      +377     
  Branches               1880     1922       +42     
=====================================================
+ Hits                    157     7660     +7503     
+ Misses                 8083      636     -7447     
- Partials                  9      330      +321     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@palisadoes palisadoes merged commit 008904a into PalisadoesFoundation:develop-postgres Jan 28, 2025
18 of 19 checks passed
@palisadoes palisadoes deleted the docs branch January 28, 2025 23:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ignore-sensitive-files-pr The contributor has a legitimate reason for editiing protected files
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant