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: 🐛 Codefair v2.0.1 #64

Merged
merged 11 commits into from
Sep 3, 2024
Merged

fix: 🐛 Codefair v2.0.1 #64

merged 11 commits into from
Sep 3, 2024

Conversation

slugb0t
Copy link
Member

@slugb0t slugb0t commented Sep 3, 2024

v.2.0.1 - 2024-09-03

Added

  • Added a migration script to update the database for users who may try to access the dashboard before the v2.0.0 bot has ran on all their repositories.
  • Added badges to the CWL card on the dashboard to show the overall status of the CWL validations.

Fixed

  • Fixed a bug where the bot would updated the overall status of the CWL validation on the database.
  • Link generator for Codefair repository settings was fixed to correctly generate the link for a user or repository.

Removed

  • Removed references to the action key in the database as it was not being used.

Copy link

Thank you for submitting this pull request! We appreciate your contribution to the project. Before we can merge it, we need to review the changes you've made to ensure they align with our code standards and meet the requirements of the project. We'll get back to you as soon as we can with feedback. Thanks again!

Copy link

sourcery-ai bot commented Sep 3, 2024

🧙 Sourcery has finished reviewing your pull request!


Tips
  • Trigger a new Sourcery review by commenting @sourcery-ai review on the pull request.
  • Continue your discussion with Sourcery by replying directly to review comments.
  • You can change your review settings at any time by accessing your dashboard:
    • Enable or disable the Sourcery-generated pull request summary or reviewer's guide;
    • Change the review language;
  • You can always contact us if you have any questions or feedback.

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

We've reviewed this pull request using the Sourcery rules engine. If you would also like our AI-powered code review then let us know.

Copy link

what-the-diff bot commented Sep 3, 2024

PR Summary

  • Database Update Script Added for Users
    A migration script has been introduced to update the database for users who might access the dashboard before the v2.0.0 bot has run on all their repositories.

  • Badges Addition to CWL Card on Dashboard
    Badges have been added to the CWL (Common Workflow Language) card on the dashboard. These will show the overall status of the CWL validations, allowing users to understand the state of their code workflow routines easily.

  • CWL Validation Status Bug Fix
    Fixed a malfunction where the bot incorrectly updated the overall status of the CWL validation in the database.

  • Improvement of Codefair Repository Settings Link Generator
    The link generator for Codefair repository settings was fixed to correctly generate the link for a user or repository. This will enhance navigation and usability.

  • Cleaning of Unused Database References
    References to the 'action' key in the database, which was not being used, have been removed. This leads to a cleaner and more streamlined database structure.

  • Update to CITATION.cff File
    The CITATION.cff file has been updated with a new DOI (Digital Object Identifier) link, providing more accurate citation information.

  • Multiple Code Modifications in bot/index.js File
    Several redundant parameters and variables have been removed from the bot/index.js file, which makes the code easier to maintain and read. Also, the bot's version was updated from 2.0.0 to 2.0.1.

  • Updates in bot/utils/tools/index.js and codemeta.json files
    In bot/utils/tools/index.js file, several function calls have been decluttered by removing unnecessary parameters. And just like bot, the codemeta.json file has had its version updated and DOI link revised.

  • UI Enhancements and Security Checks
    Badges display based on CWL validation status was added to the UI component. Several security checks have been implemented to ensure users and organizations' identities. Moreover, state management of ui was updated from 2.0.0 to 2.0.1.

  • Code Clean up in ui/server/api/dashboard files
    In various server APIs, unnecessary parameters, variables, and imports relating to analytics verification and organization verification have been removed, making the API calls more efficient and readable.

  • New Utility Files for Organization Checks
    Two new utility files: ui/server/utils/auth/isOrganizationMember.ts and ui/server/utils/auth/ownerIsOrganization.ts have been added to streamline the verification of organization membership and whether the owner of a repository is an organization or not.

@slugb0t slugb0t merged commit f858326 into staging Sep 3, 2024
Copy link

Thanks for closing this pull request! If you have any further questions, please feel free to open a new issue. We are always happy to help!

slugb0t added a commit that referenced this pull request Sep 3, 2024
* feat: ✨ improvement to bot workflow

* fix: 🐛 correct codemeta url

* fix: 🐛 correct collection call with correct name

* style: 🎨 prettier refactor

* refactor: ♻️ update on call for installation and analytics collection

* ✨ feat: add front end support for cwl validation (#41)

* ✨ feat: add support for cwl validation

* 🚧 wip: rework ui for validation_message

* ✨ feat: add support for rerunning validations

* 🐛 fix: update server error mesage key

* 🐛 fix: sanity check for dashboard issue

* 🐛 fix: update description text

* feat: ✨ CWL validations across repo, single instance db, bot restructering, updated CWL github issue template (#42)

* feat: ✨ support for .cwl file checks (#39)

* refactor: ♻️ update on ui and issue dashboard text (#40)

* feat: ✨ support for .cwl file checks

* refactor: update ui text and dashboard message

* feat: ✨ recursive search for all cwl files in repo

* wip: 🚧 handle multiple cwl validations

* feat: ✨ validate multiple cwl files across repo

* feat: ✨ validate cwl files with deployed server

* refactor: ♻️ apply collapsible table for cwl validation report

* feat: ✨ db singleton + issue number added to installation table

* chore: 🔨 code cleanup

* feat: ✨ remove db as parameters throughout codefair bot

* fix: 🐛 patch verify repo name function

* docs: 📝 add JSDoc comments on new functions

* refactor: ♻️ key value for issue number change

* feat: ✨ rerun cwl validations from frontend, on uninstall delete repo from all collections

* feat: ✨ handles for when issue is closed and reopened

* refactor: ♻️ exit push event in the case of no entry in installation collection

* feat: ✨ bot event listeners concised + extra cwl validation checks (#43)

* wip: optmizing bot code

* feat: ✨ combined event listeners for bot + cwl template on no cwl files

* 🐛 fix: rework dashboard page for clarity (#44)

* 🚧 wip: update dashboard ui

* 🚧 wip: update dashboard ui

* 💄 style: add breadcrumbs to pages

* 🐛 fix: rework license ui on dashboard

* ✏️ fix: update license body text

* 🐛 fix: vhange view to edit on dashboard buttons

* feat: ✨ action queue limit + cwl template updates (#45)

* wip: 🚧 create queue for large org installs

* fix: 🐛 cwl private repo template only if cwls exist

* fix: 🐛 gather proper file metadata and iterate through payload for push event

* fix: 🐛 correct valid/total count in cwl template

* bug: :fix: action count increase only if less than 4

* fix: 🐛 add await to db call

* fix: 🐛 overwriting previous cwl files in db patched

* feat: ✨ set action key to false upon reaching action count limit

* feat: ✨ full run through on action limit, display previous validations on issue dashboard

* dev: 📝 better comments

* feat: ✨ better comments and always show total validations on issue dashboard

* ✨ feat: Add support for DB migrations (#46)

* 🚧 wip: add support for mongodb migrations

* 🐛 fix: add support for github org membership verification

* 💄 style: update alert ui

* 🔊 chore: add console logs for migration steps

* ⏪ revert: only run one update for the migration

* ✨ feat: add a simple faq for errors (#47)

* fix: 🐛 bot patches for cwl and action queue features (#48)

* feat: ✨ remove deleted cwl files from db

* dev: 📝 better comments

* fix: 🐛 add await to db search, set to false if gatherd cwl is undefind

* refactor: ♻️ convert getcwlFiles fn to a promise

* refactor: ♻️ remove token from url string in priv repos, update emojis on validation report

* refator: ♻️ sourcery notes

* refactor: ♻️ sourcery notes (push fn out function block

* refactor: ♻️ const declaration on validateCWLFile function call

* feat: ✨ consola for logging (#49)

* 🐛 fix: check github org permissions (#50)

* 🐛 fix: check github org permissions

* 🔒️ fix: remove public config variable

* 🔇 chore: remove logs

* 🧑‍💻 chore: remove old dashboard

* refactors: ♻️ action limit update (#51)

* wip: 🚧 action queue handling

* refactor: ♻️ remove close issue feat when app is uninstalled

* 📈 feat: add metrics for ui side (#52)

* feat: ✨ analytics validatedFileCount (#53)

* fix: 🐛 if file is deleted, check for overall status before final return of template

* chore: 🔨 todo removed

* refactor: ♻️ update issue dashboard template for CWL section (#54)

* refactor: :refactor: additional cwl logs and action queue decreases

* chore: 🔨 removed unnecessary logs

* ➖ chore: remove consola from ui

* 🔊 chore: log error

* 🔥 Feat: removing old cwl UI

old cwl UI from hackathon removed

* fix: 🐛 update cwl db when file is modified

* fix: 🐛 failedcount/cwlfilecount ratio for issue template

* fix: 🐛 cwl bug patches (#55)

* wip: 🚧 🐛 patched count on modifying cwl file

* refactor: ♻️ update applycwltemplate fn to make it easier to read

* refactor: ♻️ update on cwl workflow, improved handling and validation

* wip: 🚧 bug catching cwl workflow

* feat: ✨ final touches for cwl workflow

* feat: ✨ boolean db field for fair items existence check

* refactor: ♻️ apply<fairItem>template moved to fair item file

* refactor: ♻️ align contains_license key with other collections

* feat: ✨ validation status + trigger bot rerun full validation (#56)

* feat: ✨ license_status key added to db

* refactor: ♻️ better variable name and removed unused fns

* logs: 🔊 better logging on bot side

* feat: ✨ last updated info applied to issue dashboard + rerun full repo validation command listener added

* refactor: ♻️ improved workflow for license template renderer

* feat: ✨ validate metadata files formatting

* feat: ✨ include validation check for when only one metadata file exists

* refactor: 📝 update readme run githb app locally section

* Update README.md

* refactor: ♻️ update /fairsoftware page text

* feat: ✨ Add button to direct to docs on codefair homepage

* refactor: ♻️ /fairsoftware learn more about codefair directs to /codefair

* refactor: ♻️ remove mention of fair-biors guidelines from bot

* refactor: ♻️ remove mention of fair biors guidelines in UI

* ✨ feat: bring ui dashboard to issue dashboard level (#57)

* ✨ feat: add title to cwl on dashboard

* 🚧 wip: dashboard repo layout

* 🚧 wip: dashboard repo layout

* 🚧 wip: nav state

* ✨ feat: Add breadcrumbs

* ✨ feat: add repo settings page

* ✨ feat: add repo revalidation

* feat: ✨ apply latest github info through bot

* refactor: ♻️ Load commit info based on installation collection

* fix: 🐛 view codefair settings link determine by isOrganization key

* refactor: ♻️ update bot function for clarification

* fix: 🐛 remove files that were deleted on rerun triggered from

* fix: 🐛 typo fix

* feat: ✨ links added to homepage

* ✨ feat: add sashboard badges

* 🐛 fix: downgrade nuxtlinks

---------

Co-authored-by: slugb0t <wheresdorian@gmail.com>

* 🐛 fix: undefined vars

* fix: 🐛 get default branch name for commit info

* fix: 🐛 patch iterating through existing cwl files for removal

* refactor: ♻️ Prettier refactors

* refactor: ♻️ display repos with no action limit in UI dashboard

* refactor: 🏗️ update bot file structure (#59)

* refactor: 🎨 standardize spacing of content for dashboard cards

* refactor: ♻️ update on styling of repo cards

* 🔀 merge: main to staging branch (#60)

* fix: 🐛 metadata url update + collection call correct

* fix: 🐛 typo fix and exit workflow on push event if installation does not exist

* feat: ✨ add codemeta file

* feat: ✨ add citation file

* Create CHANGELOG.md

* Update README.md

* Update README.md

---------

Co-authored-by: codefair-app[bot] <165336008+codefair-app[bot]@users.noreply.github.com>
Co-authored-by: Bhavesh Patel <b.patel@berkeley.edu>

* fix: 🐛 correct typo in README

* feat: 🔖 bump version number to v2.0.0

* feat: ✨ activate dashboard

* refactor: ♻️ remove mention of the fair-biors guidelines in bot

* feat: ✨ if issue is reopened update the latest commits in db

* feat: ✨ fetch commit details if bot yet has not done so

* revert: ⏪ remove fetching commits from UI

* Update CITATION.cff

* Update codemeta.json

* Update README.md

* Update CHANGELOG.md

* update: 📝 update CHANGELOG for v2

* refactor: ♻️ PR feedback resolved

* refactor: ♻️ update validator endpoint

* feat: ✨ migration update (#62)

* feat: ✨ enable migrations

* feat: ✨ add migrate script to bot package.json

* fix: 🐛 enable sign in button

* feat: ✨ Migrations update (#63)

* feat: ✨ enable migrations

* feat: ✨ add migrate script to bot package.json

* fix: 🐛 enable sign in button

* fix: 🐛 patch multiple entries during migration

* fix: 🐛 Codefair v2.0.1 (#64)

* wip: 🚧 apply ownerisorg check for server utils

* refactor: ♻️ remove references of action key in bot

* refactor: ♻️ remove action key from installation table

* wip: 🚧 testing global is org server function

* feat: ✨ global util fns for organization check

* bug: :fix: check correct key for overall status in cwl collection

* feat: ✨ add badges for CWL card

* feat: ✨ add owner is org check and fetch (global calls)

* feat: 🔖 prep for 2.0.1 release

* chore: 🔨 removed unnecessary logs

* refactor: ♻️ pass correct is org variable

---------

Co-authored-by: Sanjay Soundarajan <sanjay.16@live.com>
Co-authored-by: codefair-app[bot] <165336008+codefair-app[bot]@users.noreply.github.com>
Co-authored-by: Bhavesh Patel <b.patel@berkeley.edu>
slugb0t added a commit that referenced this pull request Sep 3, 2024
* fix: 🐛 Codefair v2.0.1 (#65)

* feat: ✨ improvement to bot workflow

* fix: 🐛 correct codemeta url

* fix: 🐛 correct collection call with correct name

* style: 🎨 prettier refactor

* refactor: ♻️ update on call for installation and analytics collection

* ✨ feat: add front end support for cwl validation (#41)

* ✨ feat: add support for cwl validation

* 🚧 wip: rework ui for validation_message

* ✨ feat: add support for rerunning validations

* 🐛 fix: update server error mesage key

* 🐛 fix: sanity check for dashboard issue

* 🐛 fix: update description text

* feat: ✨ CWL validations across repo, single instance db, bot restructering, updated CWL github issue template (#42)

* feat: ✨ support for .cwl file checks (#39)

* refactor: ♻️ update on ui and issue dashboard text (#40)

* feat: ✨ support for .cwl file checks

* refactor: update ui text and dashboard message

* feat: ✨ recursive search for all cwl files in repo

* wip: 🚧 handle multiple cwl validations

* feat: ✨ validate multiple cwl files across repo

* feat: ✨ validate cwl files with deployed server

* refactor: ♻️ apply collapsible table for cwl validation report

* feat: ✨ db singleton + issue number added to installation table

* chore: 🔨 code cleanup

* feat: ✨ remove db as parameters throughout codefair bot

* fix: 🐛 patch verify repo name function

* docs: 📝 add JSDoc comments on new functions

* refactor: ♻️ key value for issue number change

* feat: ✨ rerun cwl validations from frontend, on uninstall delete repo from all collections

* feat: ✨ handles for when issue is closed and reopened

* refactor: ♻️ exit push event in the case of no entry in installation collection

* feat: ✨ bot event listeners concised + extra cwl validation checks (#43)

* wip: optmizing bot code

* feat: ✨ combined event listeners for bot + cwl template on no cwl files

* 🐛 fix: rework dashboard page for clarity (#44)

* 🚧 wip: update dashboard ui

* 🚧 wip: update dashboard ui

* 💄 style: add breadcrumbs to pages

* 🐛 fix: rework license ui on dashboard

* ✏️ fix: update license body text

* 🐛 fix: vhange view to edit on dashboard buttons

* feat: ✨ action queue limit + cwl template updates (#45)

* wip: 🚧 create queue for large org installs

* fix: 🐛 cwl private repo template only if cwls exist

* fix: 🐛 gather proper file metadata and iterate through payload for push event

* fix: 🐛 correct valid/total count in cwl template

* bug: :fix: action count increase only if less than 4

* fix: 🐛 add await to db call

* fix: 🐛 overwriting previous cwl files in db patched

* feat: ✨ set action key to false upon reaching action count limit

* feat: ✨ full run through on action limit, display previous validations on issue dashboard

* dev: 📝 better comments

* feat: ✨ better comments and always show total validations on issue dashboard

* ✨ feat: Add support for DB migrations (#46)

* 🚧 wip: add support for mongodb migrations

* 🐛 fix: add support for github org membership verification

* 💄 style: update alert ui

* 🔊 chore: add console logs for migration steps

* ⏪ revert: only run one update for the migration

* ✨ feat: add a simple faq for errors (#47)

* fix: 🐛 bot patches for cwl and action queue features (#48)

* feat: ✨ remove deleted cwl files from db

* dev: 📝 better comments

* fix: 🐛 add await to db search, set to false if gatherd cwl is undefind

* refactor: ♻️ convert getcwlFiles fn to a promise

* refactor: ♻️ remove token from url string in priv repos, update emojis on validation report

* refator: ♻️ sourcery notes

* refactor: ♻️ sourcery notes (push fn out function block

* refactor: ♻️ const declaration on validateCWLFile function call

* feat: ✨ consola for logging (#49)

* 🐛 fix: check github org permissions (#50)

* 🐛 fix: check github org permissions

* 🔒️ fix: remove public config variable

* 🔇 chore: remove logs

* 🧑‍💻 chore: remove old dashboard

* refactors: ♻️ action limit update (#51)

* wip: 🚧 action queue handling

* refactor: ♻️ remove close issue feat when app is uninstalled

* 📈 feat: add metrics for ui side (#52)

* feat: ✨ analytics validatedFileCount (#53)

* fix: 🐛 if file is deleted, check for overall status before final return of template

* chore: 🔨 todo removed

* refactor: ♻️ update issue dashboard template for CWL section (#54)

* refactor: :refactor: additional cwl logs and action queue decreases

* chore: 🔨 removed unnecessary logs

* ➖ chore: remove consola from ui

* 🔊 chore: log error

* 🔥 Feat: removing old cwl UI

old cwl UI from hackathon removed

* fix: 🐛 update cwl db when file is modified

* fix: 🐛 failedcount/cwlfilecount ratio for issue template

* fix: 🐛 cwl bug patches (#55)

* wip: 🚧 🐛 patched count on modifying cwl file

* refactor: ♻️ update applycwltemplate fn to make it easier to read

* refactor: ♻️ update on cwl workflow, improved handling and validation

* wip: 🚧 bug catching cwl workflow

* feat: ✨ final touches for cwl workflow

* feat: ✨ boolean db field for fair items existence check

* refactor: ♻️ apply<fairItem>template moved to fair item file

* refactor: ♻️ align contains_license key with other collections

* feat: ✨ validation status + trigger bot rerun full validation (#56)

* feat: ✨ license_status key added to db

* refactor: ♻️ better variable name and removed unused fns

* logs: 🔊 better logging on bot side

* feat: ✨ last updated info applied to issue dashboard + rerun full repo validation command listener added

* refactor: ♻️ improved workflow for license template renderer

* feat: ✨ validate metadata files formatting

* feat: ✨ include validation check for when only one metadata file exists

* refactor: 📝 update readme run githb app locally section

* Update README.md

* refactor: ♻️ update /fairsoftware page text

* feat: ✨ Add button to direct to docs on codefair homepage

* refactor: ♻️ /fairsoftware learn more about codefair directs to /codefair

* refactor: ♻️ remove mention of fair-biors guidelines from bot

* refactor: ♻️ remove mention of fair biors guidelines in UI

* ✨ feat: bring ui dashboard to issue dashboard level (#57)

* ✨ feat: add title to cwl on dashboard

* 🚧 wip: dashboard repo layout

* 🚧 wip: dashboard repo layout

* 🚧 wip: nav state

* ✨ feat: Add breadcrumbs

* ✨ feat: add repo settings page

* ✨ feat: add repo revalidation

* feat: ✨ apply latest github info through bot

* refactor: ♻️ Load commit info based on installation collection

* fix: 🐛 view codefair settings link determine by isOrganization key

* refactor: ♻️ update bot function for clarification

* fix: 🐛 remove files that were deleted on rerun triggered from

* fix: 🐛 typo fix

* feat: ✨ links added to homepage

* ✨ feat: add sashboard badges

* 🐛 fix: downgrade nuxtlinks

---------

Co-authored-by: slugb0t <wheresdorian@gmail.com>

* 🐛 fix: undefined vars

* fix: 🐛 get default branch name for commit info

* fix: 🐛 patch iterating through existing cwl files for removal

* refactor: ♻️ Prettier refactors

* refactor: ♻️ display repos with no action limit in UI dashboard

* refactor: 🏗️ update bot file structure (#59)

* refactor: 🎨 standardize spacing of content for dashboard cards

* refactor: ♻️ update on styling of repo cards

* 🔀 merge: main to staging branch (#60)

* fix: 🐛 metadata url update + collection call correct

* fix: 🐛 typo fix and exit workflow on push event if installation does not exist

* feat: ✨ add codemeta file

* feat: ✨ add citation file

* Create CHANGELOG.md

* Update README.md

* Update README.md

---------

Co-authored-by: codefair-app[bot] <165336008+codefair-app[bot]@users.noreply.github.com>
Co-authored-by: Bhavesh Patel <b.patel@berkeley.edu>

* fix: 🐛 correct typo in README

* feat: 🔖 bump version number to v2.0.0

* feat: ✨ activate dashboard

* refactor: ♻️ remove mention of the fair-biors guidelines in bot

* feat: ✨ if issue is reopened update the latest commits in db

* feat: ✨ fetch commit details if bot yet has not done so

* revert: ⏪ remove fetching commits from UI

* Update CITATION.cff

* Update codemeta.json

* Update README.md

* Update CHANGELOG.md

* update: 📝 update CHANGELOG for v2

* refactor: ♻️ PR feedback resolved

* refactor: ♻️ update validator endpoint

* feat: ✨ migration update (#62)

* feat: ✨ enable migrations

* feat: ✨ add migrate script to bot package.json

* fix: 🐛 enable sign in button

* feat: ✨ Migrations update (#63)

* feat: ✨ enable migrations

* feat: ✨ add migrate script to bot package.json

* fix: 🐛 enable sign in button

* fix: 🐛 patch multiple entries during migration

* fix: 🐛 Codefair v2.0.1 (#64)

* wip: 🚧 apply ownerisorg check for server utils

* refactor: ♻️ remove references of action key in bot

* refactor: ♻️ remove action key from installation table

* wip: 🚧 testing global is org server function

* feat: ✨ global util fns for organization check

* bug: :fix: check correct key for overall status in cwl collection

* feat: ✨ add badges for CWL card

* feat: ✨ add owner is org check and fetch (global calls)

* feat: 🔖 prep for 2.0.1 release

* chore: 🔨 removed unnecessary logs

* refactor: ♻️ pass correct is org variable

---------

Co-authored-by: Sanjay Soundarajan <sanjay.16@live.com>
Co-authored-by: codefair-app[bot] <165336008+codefair-app[bot]@users.noreply.github.com>
Co-authored-by: Bhavesh Patel <b.patel@berkeley.edu>

* fix: 🐛 username check if not an organization

* Update isOrganizationMember.ts

---------

Co-authored-by: Sanjay Soundarajan <sanjay.16@live.com>
Co-authored-by: codefair-app[bot] <165336008+codefair-app[bot]@users.noreply.github.com>
Co-authored-by: Bhavesh Patel <b.patel@berkeley.edu>
@megasanjay megasanjay deleted the add-owner-check branch September 26, 2024 03:01
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