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

Fix volunteer onboarding workflow #126

Merged
merged 19 commits into from
Apr 12, 2024

Conversation

delano
Copy link
Contributor

@delano delano commented Apr 9, 2024

This pull request fixes the volunteer onboarding workflow by adding the necessary pages and updating the configuration files. The changes include adding stubs for legal pages (Privacy Policy, Terms of Service, and user agreements), adding a volunteer welcome page, updating titles and links, and standardizing TOML formatting. Additionally, the AI models and general configuration have been updated to improve performance and capabilities.

Fixes #39

delano added 5 commits April 9, 2024 08:59
These pages include a Privacy Policy, Terms of Service, and a user agreements.
The configuration file formatting was standardized by converting all keys to snake_case and ensuring consistent spacing and comment formatting. This improves readability and maintainability of the configuration over time by adopting a uniform style.
Changed the default AI models, increased input limits, and updated other
configuration parameters to improve performance and capabilities. The
primary model was updated to the most recent Claude release and
additional models were added to the fallback list. Token limits for
responses were increased to allow for more detailed explanations and
contexts. Other tweaks aim to enhance the experience for both human
users and the AI systems.
@delano delano self-assigned this Apr 9, 2024
@delano delano added feature A planned and/or designed feature in the pipeline dependencies Pull requests that update a dependency file process ux User experience documentation configuration changes Review effort [1-5]: 3 labels Apr 9, 2024
Copy link
Contributor

qodo-merge-pro bot commented Apr 9, 2024

CI Failure Feedback

(Checks updated until commit 356a39e)

Action: install-and-cache

Failed stage: Install dependencies [❌]

Failure summary:

The action failed due to a mismatch between the package versions specified in package.json and those
locked in pnpm-lock.yaml. This discrepancy indicates that package.json was updated without
subsequently updating the lock file, leading to an outdated pnpm-lock.yaml. The CI environment
defaults to using the frozen-lockfile option, which prevents installation if the lock file doesn't
match the package.json file. To resolve this issue, the lock file needs to be updated to reflect the
current package versions specified in package.json.

Relevant error logs:
1:  ##[group]Operating System
2:  Ubuntu
...

480:  env:
481:  PNPM_HOME: /home/runner/setup-pnpm/node_modules/.bin
482:  STORE_PATH: /home/runner/setup-pnpm/node_modules/.bin/store/v3
483:  ##[endgroup]
484:  ERR_PNPM_OUTDATED_LOCKFILE  Cannot install with "frozen-lockfile" because pnpm-lock.yaml is not up to date with package.json
485:  Note that in CI environments this setting is true by default. If you still need to run install in such cases, use "pnpm install --no-frozen-lockfile"
486:  Failure reason:
487:  specifiers in the lockfile ({"@iconify-json/game-icons":"^1.1.9","@iconify-json/heroicons":"^1.1.20","@iconify-json/ph":"^1.1.12","@iconify-json/simple-icons":"^1.1.99","@iconify-json/streamline":"^1.1.8","@nuxt/fonts":"^0.3.0","@nuxt/image":"^1.5.0","@sidebase/nuxt-auth":"^0.7.1","@tailwindcss/forms":"^0.5.7","@typescript-eslint/parser":"^7.6.0","@unovis/vue":"^1.4.0","@vitejs/plugin-vue":"^5.0.4","@vueform/nuxt":"^1.5.0","@vueform/plugin-mask":"^1.0.3","@vueform/vueform":"^1.9.4","@vueuse/nuxt":"^10.9.0","date-fns":"^3.6.0","next-auth":"^4.24.7","nitro":"^0.0.0","nuxt-og-image":"3.0.0-rc.43","nuxt-snackbar":"^1.0.4","pinia":"^2.1.7","prettier":"^3.2.5","vue":"^3.4.21","vue-router":"^4.3.0","vue3-google-map":"^0.20.0","vue3-smooth-dnd":"^0.0.6","@nuxt/devtools":"^1.1.5","@nuxt/eslint-config":"^0.2.0","@nuxt/types":"^2.17.3","@nuxt/typescript-build":"^3.0.2","@nuxt/ui":"^2.15.1","@nuxt/ui-pro":"npm:@nuxt/ui-pro-edge@latest","@nuxthq/studio":"^1.0.13","@nuxtjs/color-mode":"^3.4.0","@nuxtjs/tailwindcss":"^6.11.4","@pinia/nuxt":"^0.5.1","@types/google.maps":"^3.55.7","@types/jest":"^29.5.12","@types/node":"^20.12.7","@vue/test-utils":"^2.4.5","autoprefixer":"^10.4.19","dotenv-cli":"^7.4.1","eslint":"^8.57.0","favicons":"^7.2.0","happy-dom":"^14.7.1","nuxt":"^3.11.2","playwright-core":"^1.43.0","postcss":"^8.4.38","tailwindcss":"^3.4.3","vitest":"^1.5.0","vue-tsc":"^2.0.12"}) don't match specs in package.json ({"@nuxt/devtools":"^1.1.5","@nuxt/eslint-config":"^0.2.0","@nuxt/types":"^2.17.3","@nuxt/typescript-build":"^3.0.2","@nuxt/ui":"^2.15.1","@nuxt/ui-pro":"npm:@nuxt/ui-pro-edge@latest","@nuxthq/studio":"^1.0.13","@nuxtjs/color-mode":"^3.4.0","@nuxtjs/tailwindcss":"^6.11.4","@pinia/nuxt":"^0.5.1","@types/google.maps":"^3.55.7","@types/jest":"^29.5.12","@types/node":"^20.12.7","@vue/test-utils":"^2.4.5","autoprefixer":"^10.4.19","dotenv-cli":"^7.4.1","eslint":"^8.57.0","favicons":"^7.2.0","happy-dom":"^14.7.1","nuxt":"^3.11.2","playwright-core":"^1.43.0","postcss":"^8.4.38","tailwindcss":"^3.4.3","vitest":"^1.5.0","vue-tsc":"^2.0.12","@iconify-json/game-icons":"^1.1.9","@iconify-json/heroicons":"^1.1.20","@iconify-json/ph":"^1.1.12","@iconify-json/simple-icons":"^1.1.99","@iconify-json/streamline":"^1.1.8","@nuxt/fonts":"^0.3.0","@nuxt/image":"^1.5.0","@sidebase/nuxt-auth":"^0.7.1","@tailwindcss/forms":"^0.5.7","@typescript-eslint/parser":"^7.6.0","@unovis/vue":"^1.4.0","@vitejs/plugin-vue":"^5.0.4","@vueform/nuxt":"^1.5.0","@vueform/plugin-mask":"^1.0.3","@vueform/vueform":"^1.9.4","@vueuse/nuxt":"^10.9.0","date-fns":"^3.6.0","next-auth":"^4.24.7","nitro":"^0.0.0","nuxt-og-image":"3.0.0-rc.43","nuxt-snackbar":"^1.0.4","pinia":"^2.1.7","prettier":"^3.2.5","vue":"^3.4.0","vue-router":"^4.3.0","vue3-google-map":"^0.20.0","vue3-smooth-dnd":"^0.0.6"})
488:  ##[error]Process completed with exit code 1.

✨ CI feedback usage guide:

The CI feedback tool (/checks) automatically triggers when a PR has a failed check.
The tool analyzes the failed checks and provides several feedbacks:

  • Failed stage
  • Failed test name
  • Failure summary
  • Relevant error logs

In addition to being automatically triggered, the tool can also be invoked manually by commenting on a PR:

/checks "https://github.com/{repo_name}/actions/runs/{run_number}/job/{job_number}"

where {repo_name} is the name of the repository, {run_number} is the run number of the failed check, and {job_number} is the job number of the failed check.

Configuration options

  • enable_auto_checks_feedback - if set to true, the tool will automatically provide feedback when a check is failed. Default is true.
  • excluded_checks_list - a list of checks to exclude from the feedback, for example: ["check1", "check2"]. Default is an empty list.
  • enable_help_text - if set to true, the tool will provide a help message with the feedback. Default is true.
  • persistent_comment - if set to true, the tool will overwrite a previous checks comment with the new feedback. Default is true.
  • final_update_message - if persistent_comment is true and updating a previous checks message, the tool will also create a new message: "Persistent checks updated to latest commit". Default is true.

See more information about the checks tool in the docs.

@joshuakeaton
Copy link
Collaborator

Preparing PR description...

delano added 11 commits April 9, 2024 15:16
Add new Ruff linter package to dev dependencies and include wheels in Poetry lock file to enable static type checking and linting in CI/CD workflows. Ruff is an extremely fast linter and code formatter written in Rust that will help enforce code quality standards as codebase grows.
Note: this script will only run in dev since there will only be
configuration in dev. Even then it needs to be added manually.
This PR upgrades many outdated dev dependencies, standardizes `dev: true` and removes unused packages. It also consolidates dev script definitions for improved readability.

### Changes

- Removed unused packages:
  - `@nuxt/test-utils`: Temporary, b/c it's clashing with @sidebase/nuxt-auth in dependency resolution

No functionality changes, but lay the groundwork for future improvements by cleaning up the dependency graph and development surface area.
Add Nuxt UI Pro, TailwindCSS, and VueUse modules
Transpile Nuxt app in build config
Enable Nitro route rules for .ts and .vue files
Update TailwindCSS and VueForm configs
Import VueForm theme correctly in vueform.config.ts
* Add new 'almost there' interstial page between login and magic
* Updated input fields and layout styling
* Implemented login flow with magic link
* Added privacy links to volunteer signup
* Moved snackbar components to top level
* Added new page for magic link confirmation
Also adds dynamic debug mode in Nuxt config
* Update landing page text for better clarity
* Remove unused navigation links
* Update footer copyright notice
* Adjust some UI spacing and styling tweaks
@delano delano marked this pull request as ready for review April 11, 2024 15:50
Copy link
Contributor

PR Review

⏱️ Estimated effort to review [1-5]

4, due to the extensive changes across multiple files, including Vue components, configuration updates, and the addition of new pages. The PR touches on various aspects of the application, from UI changes to backend configurations, requiring a thorough review to ensure consistency and correctness.

🧪 Relevant tests

No

🔍 Possible issues

Possible Bug: The removal of the navigation array in 'apps/ui/pages/index.vue' without replacing or modifying related navigation functionality could potentially break existing navigation features.

Consistency Issue: The use of different icons and placeholders in form fields across different pages (e.g., 'welcome/volunteers.vue', 'login/magic.vue', 'welcome/clients.vue') might lead to a lack of UI consistency.

Redundancy: The repeated definition of similar form fields and validation logic in multiple files (e.g., 'welcome/volunteers.vue', 'welcome/clients.vue') suggests a potential for modularization or shared components to reduce redundancy and improve maintainability.

🔒 Security concerns

No

apps/ui/pages/welcome/volunteers.vue Show resolved Hide resolved
apps/ui/pages/login/magic.vue Show resolved Hide resolved
apps/ui/nuxt.config.ts Outdated Show resolved Hide resolved
Copy link
Contributor

qodo-merge-pro bot commented Apr 11, 2024

PR Code Suggestions

CategorySuggestions                                                                                                                                                       
Enhancement
Change the input type for the email field to "email" for proper validation.

The type for the email field is currently set to "text". It should be set to "email" to
ensure proper validation and keyboard layout on mobile devices.

apps/ui/pages/welcome/volunteers.vue [24-28]

 {
   name: "email",
-  type: "text",
+  type: "email",
   label: "Email",
   placeholder: "Your email address",
   icon: "i-heroicons-envelope",
 }
 
Update the input type for the email field to "email" for improved validation.

The type attribute for the email field is set to "text". For better user experience and
validation, it should be changed to "email".

apps/ui/pages/login/magic.vue [56-60]

 {
   name: "email",
-  type: "text",
+  type: "email",
   label: "Email",
   placeholder: "Your email address",
   icon: "i-heroicons-envelope",
 }
 
Correct the input type for the email field to "email" for accurate validation.

The type for the email field is incorrectly set as "text". It should be "email" to ensure
correct validation and to bring up the appropriate keyboard on mobile devices.

apps/ui/pages/welcome/clients.vue [24-28]

 {
   name: "email",
-  type: "text",
+  type: "email",
   label: "Email",
   placeholder: "Your email address",
   icon: "i-heroicons-envelope",
 }
 
Improve or remove the generic error logging for clarity.

The error message in the console.error call should provide more context or be removed if
it's not adding value. Consider enhancing the message or removing it if it's redundant.

apps/ui/pages/login/index.vue [129-132]

-console.error(
-  "A response error occurred:",
-  "Status code:",
-  response.status,
-  "Status message:",
-);
+console.error(`A response error occurred: Status code: ${response.status}, Status message: ${response.statusText}`);
 
Ensure UI consistency when changing theme colors.

When changing theme colors like 'primary' and 'gray', ensure that these changes are
reflected across all UI components to maintain a consistent look and feel.

apps/ui/app.config.ts [8-9]

-primary: 'teal',
-gray: 'zinc',
+primary: 'teal', // Ensure all components using 'primary' are updated
+gray: 'zinc', // Ensure all components using 'gray' are updated
 
Utilize "dotenv-cli" in npm scripts for effective environment variable management.

Ensure that the addition of "dotenv-cli" to the devDependencies is accompanied by its
usage in npm scripts to manage environment variables effectively.

package.json [69]

-"dotenv-cli": "^7.4.1",
+"dev": "dotenv -- nuxt dev apps/ui", # Example usage in npm script
 
Maintainability
Remove unnecessary blank lines between imports for cleaner code.

Consider removing the blank line (line 6) between imports for consistency and to adhere to
standard import organization practices.

apps/ui/vueform.config.ts [6-7]

-+
 import vueform from '@vueform/vueform/themes/vueform'
 
Possible issue
Verify compatibility of new models with the current setup.

When updating the model configuration, ensure that the selected models are compatible with
your current setup and that any necessary adjustments have been made to accommodate the
new models' requirements.

.pr_agent.toml [7-8]

-model = "claude-3-sonnet-20240229"
-model_turbo = "claude-instant-1.2"
+model = "claude-3-sonnet-20240229" # Verify compatibility
+model_turbo = "claude-instant-1.2" # Verify compatibility
 
Best practice
Document the use of environment variables for clarity and ease of setup.

Ensure that the environment variables used (e.g., PRAGENT_MODEL, PRAGENT_MODEL_TURBO) are
properly documented and included in your project's documentation or .env.example file to
facilitate setup for new developers.

bin/pr-agent [37-38]

-global_settings.set("CONFIG.MODEL", os.getenv("PRAGENT_MODEL"))
-global_settings.set("CONFIG.MODEL_TURBO", os.getenv("PRAGENT_MODEL_TURBO"))
+# Ensure these environment variables are documented:
+# PRAGENT_MODEL - Model used by PR Agent
+# PRAGENT_MODEL_TURBO - Turbo model for faster processing
 

✨ Improve tool usage guide:

Overview:
The improve tool scans the PR code changes, and automatically generates suggestions for improving the PR code. The tool can be triggered automatically every time a new PR is opened, or can be invoked manually by commenting on a PR.

  • When commenting, to edit configurations related to the improve tool (pr_code_suggestions section), use the following template:
/improve --pr_code_suggestions.some_config1=... --pr_code_suggestions.some_config2=...
[pr_code_suggestions]
some_config1=...
some_config2=...

See the improve usage page for a comprehensive guide on using this tool.

@AnimalFoodBank AnimalFoodBank deleted a comment from joshuakeaton Apr 11, 2024
This commit updates many outdated dependencies throughout the codebase
to their latest versions. Key changes include:

- Updating @types/node from 20.11.30 to 20.12.7 to resolve type errors
- Updating multiple @unocss packages from 0.59.0 to 0.59.1 to fix issues
- Bumping koa from 2.15.2 to 2.15.3 to address vulnerabilities
- Updating vitest and related packages from 1.4.0 to 1.5.0 for new
features and bugfixes
- Various other minor versions bumps across packages

All updates were tested and the code continues to build and run as
expected with no regressions encountered. Package versions were chosen
based on SemVer constraints and latest releases at the time of the
update.
@delano delano changed the title [WIP] Fix volunteer onboarding workflow Fix volunteer onboarding workflow Apr 11, 2024
@van
Copy link
Collaborator

van commented Apr 11, 2024

PR Code Suggestions

CategorySuggestions                                                                                                                                                       
Enhancement
Use a computed property for dynamic date operations.

Consider using a computed property or a method to handle dynamic date operations, such as
getting the current year. This approach improves readability and maintainability,
especially if the logic for date manipulation becomes more complex in the future.

apps/ui/components/Footer.vue [47]

-Animal Food Bank Foundation © {{ new Date().getFullYear() }}.
+Animal Food Bank Foundation © {{ currentYear }}.
 
Improve readability by breaking content into smaller sections.

For the introductory text on the homepage, consider breaking the content into smaller
paragraphs or sections with subheadings. This can improve readability and engagement by
making the text easier to scan and digest for visitors.

apps/ui/pages/index.vue [30]

-We are a volunteer-operated, non-funded non-profit providing pet food and supplies to pets in need. We do this through our own pet food bank program, as well as by providing pet food and supplies to other organizations helping pets in need.
+<p>We are a volunteer-operated, non-funded non-profit providing pet food and supplies to pets in need.</p>
+<p>We do this through our own pet food bank program, as well as by providing pet food and supplies to other organizations helping pets in need.</p>
 
Consolidate glob patterns in TailwindCSS content configuration for maintainability.

Consider consolidating the glob patterns for your content configuration to make it more
maintainable and to avoid potential redundancy. For example, you can use a single pattern
to match all Vue components, layouts, and pages instead of specifying each directory
separately.

apps/ui/tailwind.config.ts [6-11]

-"./components/**/*.{js,vue,ts}",
-"./layouts/**/*.vue",
-"./pages/**/*.vue",
-"./plugins/**/*.{js,ts}",
-"./app.vue",
-"./error.vue",
+"./{components,layouts,pages,plugins}/**/*.{js,vue,ts}",
+"./{app,error}.vue",
 
Possible issue
Verify the removal of crucial navigation links.

Ensure that the removal of the 'Request Food' link is intentional and aligns with the
application's navigation and user access requirements. If this link is crucial for users
to access food requests, consider adding it back or providing an alternative access point
within the application.

apps/ui/components/Header.vue [7-9]

+},{
+  label: 'Request Food',
+  to: '/requests/new'
 },{
   label: 'About Us',
   to: '/about'
 
User experience
Provide user-friendly error messages for form submission errors.

When handling form submission errors, it's beneficial to provide user-friendly error
messages or feedback within the UI. This can help users understand what went wrong and how
to proceed, improving the overall user experience.

apps/ui/pages/login/index.vue [129-132]

-console.error(
-  "A response error occurred:",
-  "Status code:",
-  response.status,
-  "Status message:",
+showErrorSnackbar(`Error: ${response.status} ${response.statusText}. Please try again.`);
 
Maintainability
Remove or document the purpose of commented-out code.

Consider removing commented-out code before merging, as it can clutter the configuration
file and make it harder to read. If the code is meant to be used in the future, document
its purpose clearly or consider keeping it in a separate branch or documentation.

apps/ui/nuxt.config.ts [14]

-// '@nuxt/test-utils/module',
 
+
Use descriptive names for command-line arguments for clarity.

To improve code readability and maintainability, consider using a more descriptive name
for your command-line arguments. For example, instead of --pat, use --github-pat to make
it clear that this argument is for a GitHub Personal Access Token.

bin/pr-agent [20-24]

 parser.add_argument(
-    "--pat",
+    "--github-pat",
     type=str,
-    help="Github PAT (fine-grained and approved for org)",
+    help="GitHub Personal Access Token (fine-grained and approved for org)",
     required=False,
 )
 
Best practice
Remove unused imports to clean up the configuration file.

Since you're importing vueform from @vueform/vueform/themes/vueform, ensure that this
import is actually used within your configuration. If it's not being used, consider
removing the import to keep your configuration clean and concise.

apps/ui/vueform.config.ts [7]

-import vueform from '@vueform/vueform/themes/vueform'
+// If vueform is used, ensure it's properly configured here
+// Otherwise, remove the unused import
 
Use exact versions for dependencies to avoid potential conflicts.

To ensure compatibility and prevent potential conflicts, specify exact versions for your
dependencies instead of using the caret (^) version range. This can help avoid issues
caused by unexpected updates to dependencies.

package.json [33-34]

-"@tailwindcss/forms": "^0.5.7",
-"@typescript-eslint/parser": "^7.6.0",
+"@tailwindcss/forms": "0.5.7",
+"@typescript-eslint/parser": "7.6.0",
 
Security
Use environment variables for sensitive keys to enhance security.

It's recommended to keep sensitive information such as API keys and tokens out of
version-controlled files. Consider using environment variables for openai_key and
anthropic_key to enhance the security of your application.

.pr_agent.toml [41-42]

-openai_key = os.getenv("PRAGENT_OPENAI_KEY")  # OpenAI key
-anthropic_key = os.getenv("PRAGENT_ANTHROPIC_KEY")  # Anthropic key
+# Use environment variables directly in the application logic where needed
+# Avoid storing them in version-controlled configuration files
 

✨ Improve tool usage guide:

Overview:
The improve tool scans the PR code changes, and automatically generates suggestions for improving the PR code. The tool can be triggered automatically every time a new PR is opened, or can be invoked manually by commenting on a PR.

  • When commenting, to edit configurations related to the improve tool (pr_code_suggestions section), use the following template:
/improve --pr_code_suggestions.some_config1=... --pr_code_suggestions.some_config2=...
[pr_code_suggestions]
some_config1=...
some_config2=...

See the improve usage page for a comprehensive guide on using this tool.

For client and volunteer onboarding and login forms
Copy link
Contributor Author

@delano delano left a comment

Choose a reason for hiding this comment

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

appreciate

apps/ui/nuxt.config.ts Outdated Show resolved Hide resolved
apps/ui/pages/welcome/volunteers.vue Show resolved Hide resolved
apps/ui/pages/login/magic.vue Show resolved Hide resolved
Remove explicit transpile (leftover from debugging)

Signed-off-by: Delano <1206+delano@users.noreply.github.com>
@delano delano merged commit 70e9fa1 into feature/volunteer-support Apr 12, 2024
1 check failed
@delano delano deleted the 39-workflow-volunteer-onboarding branch April 12, 2024 19:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
configuration changes dependencies Pull requests that update a dependency file documentation feature A planned and/or designed feature in the pipeline process Review effort [1-5]: 4 ux User experience
Projects
Status: ✔️ Done
Development

Successfully merging this pull request may close these issues.

3 participants