-
Notifications
You must be signed in to change notification settings - Fork 2
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
refactor: β»οΈ π π π§βπ» Add Environment Variables and Convert Logging to Use Logwatch #119
Conversation
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! |
Reviewer's Guide by SourceryThis PR refactors the logging system by replacing direct console logging with a centralized logwatch utility and adds environment variables for configuration. The changes primarily focus on standardizing logging patterns and improving configuration management across the application. Class diagram for Logwatch utilityclassDiagram
class Logwatch {
+constructor(endpoint)
+success(message, isJson=false)
+warn(message, isJson=false)
+info(message, isJson=false)
+error(message, isJson=false)
+_sendLog(level, message, format)
}
note for Logwatch "Centralized logging utility replacing consola"
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Thanks for making updates to your pull request. Our team will take a look and provide feedback as soon as possible. Please wait for any GitHub Actions to complete before editing your pull request. If you have any additional questions or concerns, feel free to let us know. Thank you for your contributions! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @slugb0t - I've reviewed your changes and they look great!
Here's what I looked at during the review
- π‘ General issues: 2 issues found
- π‘ Security: 1 issue found
- π’ Testing: all looks good
- π’ Complexity: all looks good
- π’ Documentation: all looks good
Help me be more useful! Please click π or π on each comment and I'll use the feedback to improve your reviews.
} | ||
|
||
const publishedDeposition = await publishDeposition.json(); | ||
consola.success("Zenodo deposition published successfully at:", publishedDeposition.links.latest_html); | ||
logwatch.success(`Zenodo deposition published successfully at: ${publishedDeposition.links.latest_html}`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion (bug_risk): Add response status code check before parsing JSON response
Should verify publishDeposition.ok before attempting to parse JSON to avoid potential runtime errors with malformed responses.
} | |
const publishedDeposition = await publishDeposition.json(); | |
consola.success("Zenodo deposition published successfully at:", publishedDeposition.links.latest_html); | |
logwatch.success(`Zenodo deposition published successfully at: ${publishedDeposition.links.latest_html}`); | |
const publishDeposition = await fetch( | |
`${ZENODO_API_ENDPOINT}/deposit/depositions/${depositionId}/actions/publish`, | |
{ | |
} | |
if (!publishDeposition.ok) { | |
const errorText = await publishDeposition.text(); | |
throw new Error(`Failed to publish Zenodo deposition. Status: ${publishDeposition.status}: ${publishDeposition.statusText}`, { cause: errorText }); | |
} | |
const publishedDeposition = await publishDeposition.json(); | |
logwatch.success(`Zenodo deposition published successfully at: ${publishedDeposition.links.latest_html}`); |
@@ -7,7 +8,7 @@ class Logwatch { | |||
*/ | |||
constructor(endpoint) { | |||
const BOT_ENDPOINT = | |||
"https://logwatch.fairdataihub.org/api/log/cm4hkn79200027r01ya9gij7r"; | |||
BOT_LOGWATCH_URL; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
issue: Add validation for BOT_LOGWATCH_URL environment variable
Should validate that BOT_LOGWATCH_URL is defined and is a valid URL at initialization time to prevent runtime errors.
export async function validateCWLFile(downloadUrl) { | ||
try { | ||
const response = await fetch("https://cwl-validate.codefair.io/validate-cwl", { | ||
const response = await fetch(`${VALIDATOR_URL}/validate-cwl`, { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
π¨ suggestion (security): Add URL validation for VALIDATOR_URL environment variable
Should validate VALIDATOR_URL is a properly formatted URL before using it in fetch calls.
export async function validateCWLFile(downloadUrl) { | |
try { | |
const response = await fetch("https://cwl-validate.codefair.io/validate-cwl", { | |
const response = await fetch(`${VALIDATOR_URL}/validate-cwl`, { | |
function isValidUrl(string) { | |
try { | |
new URL(string); | |
return true; | |
} catch (_) { | |
return false; | |
} | |
} | |
export async function validateCWLFile(downloadUrl) { | |
try { | |
if (!VALIDATOR_URL || !isValidUrl(VALIDATOR_URL)) { | |
logwatch.error({message: "Invalid VALIDATOR_URL environment variable"}, true); | |
return [false, "Configuration error: Invalid validator URL"]; | |
} | |
const response = await fetch(`${VALIDATOR_URL}/validate-cwl`, { |
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! |
β¦ Use Logwatch (#120) * refactor: β»οΈ transfer validation api to codefair repo (#106) * π chore: rename `validator-api` to `validator` * π· ci: add validator deploy * π· ci: add validator healthcheck * π· ci: add validator deploy for prod * refactor: β»οΈ update codefair name * feat: β¨ Metadata + license validators + bug patches (#107) * merge: π merge main to staging * refactor: β»οΈ π Codefair 3.1.0 (#89) * fix: π patch removing pull_request.closed bug on metadata pr merge * fix: π don't update firstPublished in the codemeta file + better logs * fix: π patch error on reading db entry when it doesn't exist * chore: π better log on successful Zenodo publish * style: π¨ margins between text and icon * feat: β¨ links to the list of tools used for codefair in /codefair * refactor: β¨ β»οΈ abstract the license validation fn * doc: π update changelog * feat: β¨ β»οΈ abstraction to zenodo workflow * wip: π§ abstracting zenodo workflow * feat: β¨ add help link in the Zenodo release page * refactor: β»οΈ β¨ abstract out github release functions * refactor: π β»οΈ improve error tracing in metadata file * chore: π¨ remove todo * refactor: β¨ β»οΈ abstracted Zenodo workflow (bot) * wip: π§ save custom license content when no assertion is provided * β¨ feat: add support for custom licenses (#90) * β¨ feat: add support for custom licenses * π fix: reset citation license field * π fix: update zenodo workflow for custom licenses * fix: π license is valid with custom license * feat: β¨ custom license template * β¨ feat: update codemeta, license and cwl ui paths (#91) * β¨ feat: update meta paths for consistency * π fix: updatel icense request path * β¨ feat: add support for custom license title (#92) * refactor: β»οΈ β¨ new patches for license, cwl, metadata UI's * refactor: β¨ β»οΈ apply migrations from UI to bot * feat: β¨ request custom license title from user * refactor: β»οΈ hide message box when custom license title is blank * refactor: β»οΈ issue dashboard requests custom title * feat: β¨ Saving custom title (#93) * feat: β¨ save custom title option * refactor: :recyle: reuse saveLicenseDraft for storing custom license title * refactor: β»οΈ join draft and save title buttons together * refactor: β»οΈ use naive-ui's properties for styling * chore: π¨ remove typo * chore: π¨ remove unused variables * feat: β¨ toasts for custom title saved button * refactor: β»οΈ function rename * feat: β¨ create Zenodo metadata fn handles custom licenses * feat: β¨ custom license reference for archival workflow * refactor: β»οΈ stop creating identifiers for new db entries * refactor: β»οΈ π revert allowing custom licenses for zenodo * refactor: β»οΈ Custom License Support (#94) * refactor: β»οΈ β¨ custom title saved updates dashboard, disable create release btn when custom license * refactor: β»οΈ block progress of fair release if license is custom * feat: β¨ listener for when custom license title is saved through UI * feat: β¨ prevent fair release if not fair compliant * refactor: β»οΈ improve license validation and update template text for custom licenses * refactor: β»οΈ re-render issue from ui side * refactor: β»οΈ update to message explaining custom licenses * db calls running in parallel * fix: π prevent Zendo section from being seen when the license is custom * fix: π trim license content before comparison --------- Co-authored-by: Sanjay Soundarajan <sanjay.16@live.com> * refactor: β»οΈ safety checks for protected middleware * refacotr: β»οΈ update protectRoute to redirect to login when no user or session * feat: :fix: redirect to login if not signed in * refactor: β»οΈ remove import * chore: π π¨ remove logs * docs: π update changelog * fix: π check license content all times * fix: π update on zenodo ui page * feat: β¨ delete branch after pr has been closed/merged * chore: π¨ spacing in changelog * wip: π§ individual validation requests for license and metadata * feat: β¨ license validation endpoint * wip: π§ creating updated metadata validation * wip: π§ patches for metadata revalidation workflow * wip: π§ validation for codemeta * doc: π jsdoc comments on fns * fix: π template renderer will stop using old links (#99) * fix: π rerender template will stop using old links * doc: π update CHANGELOG * doc: π update metadata * fix: π preserve authors and contributors from codemeta * feat: β¨ re-validated codemeta from repo dashboard * fix: π await metadata validation * feat: β¨ codemeta validation extended with microservice validator * refactor: β»οΈ update timestamps to be unix format * feat: β¨ clean privatekey env before use * refactor: β»οΈ update cwl validation endpoint * wip: π§ send validation message to db * feat: β¨ create migrations for metadata validation messages * wip: π§ creating json schema for codemeta.json validations * π· ci: setup deployment environments (#101) * π· ci: setup for staging env (#103) Co-authored-by: Sanjay Soundarajan <sanjay.16@live.com> Co-authored-by: slugb0t <wheresdorian@gmail.com> fix: π template renderer will stop using old links (#99) * fix: π adjust env variables used after env changes * π· ci: cleanup dockerfile * feat: β¨ codemeta schema first draft * π· ci: cleanup dockerfile * π· ci: cleanup dockerfile * π· ci: cleanup dockerfile * π· ci: setup for staging env * π· ci: setup for staging env * π· ci: setup for staging env * π· ci: setup for staging env * π· ci: cleanup dockerfile * π· ci: fix staging deploys (#104) * wip: π§ abstracting cwl workflow * refactor: β»οΈ update codemeta schema to validate against the raw codemeta.json files * refactor: β»οΈ update codemeta schema for additional fields * feat: β¨ validating raw content of codemeta.json file for 3.0 * refactor: β»οΈ create required fields for codemeta schema * wip: π§ testing validation responses for db * handle codemeta.json 3.0 and 2.0 versioning * fix: π correct branch watch for staging deployment action * doc: π update changelog for 3.2.0 release * feat: β¨ align bot prisma with ui * fix: π bug patch for cwl workflow * feat: β¨ metadata workflow update * refactor: β»οΈ preserving authors and contributors * wip: π§ update the metadata workflow after discussions * fix: π don't create cwlobject twice * refactor: β»οΈ send 200 status when invalid codemeta * refactor: β»οΈ update codemeta validation schema * refactor: β»οΈ do not revalidate metadata files for push events unless metadata files are updated themselves * wip: π§ seperate rerun validation with regather information * wip: π§ remove command from issue dashboard if error occurs (allows retry) * refactor: β»οΈ update the issue body after successful validation (remove the command from the issue body) * refactor: β»οΈ add additional key to codemeta schema * refactor: β»οΈ remove the regather options from the UI as validation is still needed when regathering * fix: π pr button updated with new links * fix: π patch variable declaration not in scope * refactor: β»οΈ update on the dropdown icons * refactor: β»οΈ update the keys of the cwl object * refactor: β»οΈ update the getcwlfiles function --------- Co-authored-by: Sanjay Soundarajan <sanjay.16@live.com> * fix: π use the correct env variable for private key * fix: π Codefair v3.2.0 finalization (#113) * fix: π correct cwlObject variables in push event * fix: π better error message in metadata workflow + collect missing fields from codemeta.json * fix: π apply await to async function call * refactor: β»οΈ removed unused imports * refactor: β»οΈ add try catch in then statement of promise * fix: π missing fields in codemeta gathering + add error handling for convertCitationForDB fn * refactor: β»οΈ add try catch to renderer to preserve errors * fix: π preserve metadata validation results in db * wip: π§ validation results being displayed through the repo dashboard * wip: π§ displaying metadata validation results in seperate pages * feat: β¨ validation page for codemeta * fix: π patch fundingCode not being preserved from codemeta * wip: π§ final design for validation results * feat: β¨ add view validation results conditionally * test: βοΈ ensuring validation progresses accordingly * feat: β¨ popover messages for metadata badges * feat: β¨ if metadata file fails to parse then update validation message * fix: π update schema to handle 2.0 and 3.0 authors * style: π¨ formatting * fix: π add releaseNotes key to schema for 3.0 versions * refactor: βοΈ change wording * fix: π validate metadata file that was updated only on push events * chore: π remove test logs * fix: π migrate db during deployment * fix: π revert * fix: π typo on dockerfile * refactor: β»οΈ use npm instead of yarn for migration * refactor: β»οΈ access db url during prisma build * refactor: β»οΈ apply node env * π ci: copy package json * π ci: revert arg * π ci: add prisma migrate to ci * π ci: add prisma migrate to ci * π· ci: update dockerfile * refactor: β»οΈ use deployed validator * fix: π when license is updated validate metadata files * fix: π validation returns codemeta version on errors * π fix: add basic logwatch * fix: π add @type key for 2.0 codemeta.json files * refactor: β»οΈ updated required fields for codemeta schmea * π fix: add logwatch support * π fix: add json to logwatch * fix: π patch json parse issue * fix: π update logging parameters * refactor: β»οΈ point a folder above for codemeta-schema * refactor: β»οΈ update dockerfile to include schema * fix: π ensure authors have roles key * refactor: β»οΈ π convert some consola logs to logwatch * fix: π roles are optional in save request * chore: π remove dev logs * doc: π update changelog * refactor: β»οΈ revert roles key being optional * fix: π add logwatch.start method * fix: π ensure contrib and authros have roles * fix: π CWL handles multiple installations * refactor: β»οΈ update log error * feat: β¨ purge zenodo token when sign in is required * fix: π make login fn asyncronous * refactor: π¨ update spacing and color of validation results button * fix: π bad logwatch call removed * chore: π¨ sync main to staging (#118) * fix: π Zenodo callback issue resolved with purging token before sign in (#116) * refactor: β»οΈ transfer validation api to codefair repo (#106) * π chore: rename `validator-api` to `validator` * π· ci: add validator deploy * π· ci: add validator healthcheck * π· ci: add validator deploy for prod * refactor: β»οΈ update codefair name * feat: β¨ Metadata + license validators + bug patches (#107) * merge: π merge main to staging * refactor: β»οΈ π Codefair 3.1.0 (#89) * fix: π patch removing pull_request.closed bug on metadata pr merge * fix: π don't update firstPublished in the codemeta file + better logs * fix: π patch error on reading db entry when it doesn't exist * chore: π better log on successful Zenodo publish * style: π¨ margins between text and icon * feat: β¨ links to the list of tools used for codefair in /codefair * refactor: β¨ β»οΈ abstract the license validation fn * doc: π update changelog * feat: β¨ β»οΈ abstraction to zenodo workflow * wip: π§ abstracting zenodo workflow * feat: β¨ add help link in the Zenodo release page * refactor: β»οΈ β¨ abstract out github release functions * refactor: π β»οΈ improve error tracing in metadata file * chore: π¨ remove todo * refactor: β¨ β»οΈ abstracted Zenodo workflow (bot) * wip: π§ save custom license content when no assertion is provided * β¨ feat: add support for custom licenses (#90) * β¨ feat: add support for custom licenses * π fix: reset citation license field * π fix: update zenodo workflow for custom licenses * fix: π license is valid with custom license * feat: β¨ custom license template * β¨ feat: update codemeta, license and cwl ui paths (#91) * β¨ feat: update meta paths for consistency * π fix: updatel icense request path * β¨ feat: add support for custom license title (#92) * refactor: β»οΈ β¨ new patches for license, cwl, metadata UI's * refactor: β¨ β»οΈ apply migrations from UI to bot * feat: β¨ request custom license title from user * refactor: β»οΈ hide message box when custom license title is blank * refactor: β»οΈ issue dashboard requests custom title * feat: β¨ Saving custom title (#93) * feat: β¨ save custom title option * refactor: :recyle: reuse saveLicenseDraft for storing custom license title * refactor: β»οΈ join draft and save title buttons together * refactor: β»οΈ use naive-ui's properties for styling * chore: π¨ remove typo * chore: π¨ remove unused variables * feat: β¨ toasts for custom title saved button * refactor: β»οΈ function rename * feat: β¨ create Zenodo metadata fn handles custom licenses * feat: β¨ custom license reference for archival workflow * refactor: β»οΈ stop creating identifiers for new db entries * refactor: β»οΈ π revert allowing custom licenses for zenodo * refactor: β»οΈ Custom License Support (#94) * refactor: β»οΈ β¨ custom title saved updates dashboard, disable create release btn when custom license * refactor: β»οΈ block progress of fair release if license is custom * feat: β¨ listener for when custom license title is saved through UI * feat: β¨ prevent fair release if not fair compliant * refactor: β»οΈ improve license validation and update template text for custom licenses * refactor: β»οΈ re-render issue from ui side * refactor: β»οΈ update to message explaining custom licenses * db calls running in parallel * fix: π prevent Zendo section from being seen when the license is custom * fix: π trim license content before comparison --------- Co-authored-by: Sanjay Soundarajan <sanjay.16@live.com> * refactor: β»οΈ safety checks for protected middleware * refacotr: β»οΈ update protectRoute to redirect to login when no user or session * feat: :fix: redirect to login if not signed in * refactor: β»οΈ remove import * chore: π π¨ remove logs * docs: π update changelog * fix: π check license content all times * fix: π update on zenodo ui page * feat: β¨ delete branch after pr has been closed/merged * chore: π¨ spacing in changelog * wip: π§ individual validation requests for license and metadata * feat: β¨ license validation endpoint * wip: π§ creating updated metadata validation * wip: π§ patches for metadata revalidation workflow * wip: π§ validation for codemeta * doc: π jsdoc comments on fns * fix: π template renderer will stop using old links (#99) * fix: π rerender template will stop using old links * doc: π update CHANGELOG * doc: π update metadata * fix: π preserve authors and contributors from codemeta * feat: β¨ re-validated codemeta from repo dashboard * fix: π await metadata validation * feat: β¨ codemeta validation extended with microservice validator * refactor: β»οΈ update timestamps to be unix format * feat: β¨ clean privatekey env before use * refactor: β»οΈ update cwl validation endpoint * wip: π§ send validation message to db * feat: β¨ create migrations for metadata validation messages * wip: π§ creating json schema for codemeta.json validations * π· ci: setup deployment environments (#101) * π· ci: setup for staging env (#103) Co-authored-by: Sanjay Soundarajan <sanjay.16@live.com> Co-authored-by: slugb0t <wheresdorian@gmail.com> fix: π template renderer will stop using old links (#99) * fix: π adjust env variables used after env changes * π· ci: cleanup dockerfile * feat: β¨ codemeta schema first draft * π· ci: cleanup dockerfile * π· ci: cleanup dockerfile * π· ci: cleanup dockerfile * π· ci: setup for staging env * π· ci: setup for staging env * π· ci: setup for staging env * π· ci: setup for staging env * π· ci: cleanup dockerfile * π· ci: fix staging deploys (#104) * wip: π§ abstracting cwl workflow * refactor: β»οΈ update codemeta schema to validate against the raw codemeta.json files * refactor: β»οΈ update codemeta schema for additional fields * feat: β¨ validating raw content of codemeta.json file for 3.0 * refactor: β»οΈ create required fields for codemeta schema * wip: π§ testing validation responses for db * handle codemeta.json 3.0 and 2.0 versioning * fix: π correct branch watch for staging deployment action * doc: π update changelog for 3.2.0 release * feat: β¨ align bot prisma with ui * fix: π bug patch for cwl workflow * feat: β¨ metadata workflow update * refactor: β»οΈ preserving authors and contributors * wip: π§ update the metadata workflow after discussions * fix: π don't create cwlobject twice * refactor: β»οΈ send 200 status when invalid codemeta * refactor: β»οΈ update codemeta validation schema * refactor: β»οΈ do not revalidate metadata files for push events unless metadata files are updated themselves * wip: π§ seperate rerun validation with regather information * wip: π§ remove command from issue dashboard if error occurs (allows retry) * refactor: β»οΈ update the issue body after successful validation (remove the command from the issue body) * refactor: β»οΈ add additional key to codemeta schema * refactor: β»οΈ remove the regather options from the UI as validation is still needed when regathering * fix: π pr button updated with new links * fix: π patch variable declaration not in scope * refactor: β»οΈ update on the dropdown icons * refactor: β»οΈ update the keys of the cwl object * refactor: β»οΈ update the getcwlfiles function --------- Co-authored-by: Sanjay Soundarajan <sanjay.16@live.com> * fix: π use the correct env variable for private key * fix: π Codefair v3.2.0 finalization (#113) * fix: π correct cwlObject variables in push event * fix: π better error message in metadata workflow + collect missing fields from codemeta.json * fix: π apply await to async function call * refactor: β»οΈ removed unused imports * refactor: β»οΈ add try catch in then statement of promise * fix: π missing fields in codemeta gathering + add error handling for convertCitationForDB fn * refactor: β»οΈ add try catch to renderer to preserve errors * fix: π preserve metadata validation results in db * wip: π§ validation results being displayed through the repo dashboard * wip: π§ displaying metadata validation results in seperate pages * feat: β¨ validation page for codemeta * fix: π patch fundingCode not being preserved from codemeta * wip: π§ final design for validation results * feat: β¨ add view validation results conditionally * test: βοΈ ensuring validation progresses accordingly * feat: β¨ popover messages for metadata badges * feat: β¨ if metadata file fails to parse then update validation message * fix: π update schema to handle 2.0 and 3.0 authors * style: π¨ formatting * fix: π add releaseNotes key to schema for 3.0 versions * refactor: βοΈ change wording * fix: π validate metadata file that was updated only on push events * chore: π remove test logs * fix: π migrate db during deployment * fix: π revert * fix: π typo on dockerfile * refactor: β»οΈ use npm instead of yarn for migration * refactor: β»οΈ access db url during prisma build * refactor: β»οΈ apply node env * π ci: copy package json * π ci: revert arg * π ci: add prisma migrate to ci * π ci: add prisma migrate to ci * π· ci: update dockerfile * refactor: β»οΈ use deployed validator * fix: π when license is updated validate metadata files * fix: π validation returns codemeta version on errors * π fix: add basic logwatch * fix: π add @type key for 2.0 codemeta.json files * refactor: β»οΈ updated required fields for codemeta schmea * π fix: add logwatch support * π fix: add json to logwatch * fix: π patch json parse issue * fix: π update logging parameters * refactor: β»οΈ point a folder above for codemeta-schema * refactor: β»οΈ update dockerfile to include schema * fix: π ensure authors have roles key * refactor: β»οΈ π convert some consola logs to logwatch * fix: π roles are optional in save request * chore: π remove dev logs * doc: π update changelog * refactor: β»οΈ revert roles key being optional * fix: π add logwatch.start method * fix: π ensure contrib and authros have roles * fix: π CWL handles multiple installations * refactor: β»οΈ update log error * feat: β¨ purge zenodo token when sign in is required * fix: π make login fn asyncronous --------- Co-authored-by: Sanjay Soundarajan <sanjay.16@live.com> * refactor: π¨ update view validation & edit metadata buttons (#117) * refactor: β»οΈ transfer validation api to codefair repo (#106) * π chore: rename `validator-api` to `validator` * π· ci: add validator deploy * π· ci: add validator healthcheck * π· ci: add validator deploy for prod * refactor: β»οΈ update codefair name * feat: β¨ Metadata + license validators + bug patches (#107) * merge: π merge main to staging * refactor: β»οΈ π Codefair 3.1.0 (#89) * fix: π patch removing pull_request.closed bug on metadata pr merge * fix: π don't update firstPublished in the codemeta file + better logs * fix: π patch error on reading db entry when it doesn't exist * chore: π better log on successful Zenodo publish * style: π¨ margins between text and icon * feat: β¨ links to the list of tools used for codefair in /codefair * refactor: β¨ β»οΈ abstract the license validation fn * doc: π update changelog * feat: β¨ β»οΈ abstraction to zenodo workflow * wip: π§ abstracting zenodo workflow * feat: β¨ add help link in the Zenodo release page * refactor: β»οΈ β¨ abstract out github release functions * refactor: π β»οΈ improve error tracing in metadata file * chore: π¨ remove todo * refactor: β¨ β»οΈ abstracted Zenodo workflow (bot) * wip: π§ save custom license content when no assertion is provided * β¨ feat: add support for custom licenses (#90) * β¨ feat: add support for custom licenses * π fix: reset citation license field * π fix: update zenodo workflow for custom licenses * fix: π license is valid with custom license * feat: β¨ custom license template * β¨ feat: update codemeta, license and cwl ui paths (#91) * β¨ feat: update meta paths for consistency * π fix: updatel icense request path * β¨ feat: add support for custom license title (#92) * refactor: β»οΈ β¨ new patches for license, cwl, metadata UI's * refactor: β¨ β»οΈ apply migrations from UI to bot * feat: β¨ request custom license title from user * refactor: β»οΈ hide message box when custom license title is blank * refactor: β»οΈ issue dashboard requests custom title * feat: β¨ Saving custom title (#93) * feat: β¨ save custom title option * refactor: :recyle: reuse saveLicenseDraft for storing custom license title * refactor: β»οΈ join draft and save title buttons together * refactor: β»οΈ use naive-ui's properties for styling * chore: π¨ remove typo * chore: π¨ remove unused variables * feat: β¨ toasts for custom title saved button * refactor: β»οΈ function rename * feat: β¨ create Zenodo metadata fn handles custom licenses * feat: β¨ custom license reference for archival workflow * refactor: β»οΈ stop creating identifiers for new db entries * refactor: β»οΈ π revert allowing custom licenses for zenodo * refactor: β»οΈ Custom License Support (#94) * refactor: β»οΈ β¨ custom title saved updates dashboard, disable create release btn when custom license * refactor: β»οΈ block progress of fair release if license is custom * feat: β¨ listener for when custom license title is saved through UI * feat: β¨ prevent fair release if not fair compliant * refactor: β»οΈ improve license validation and update template text for custom licenses * refactor: β»οΈ re-render issue from ui side * refactor: β»οΈ update to message explaining custom licenses * db calls running in parallel * fix: π prevent Zendo section from being seen when the license is custom * fix: π trim license content before comparison --------- Co-authored-by: Sanjay Soundarajan <sanjay.16@live.com> * refactor: β»οΈ safety checks for protected middleware * refacotr: β»οΈ update protectRoute to redirect to login when no user or session * feat: :fix: redirect to login if not signed in * refactor: β»οΈ remove import * chore: π π¨ remove logs * docs: π update changelog * fix: π check license content all times * fix: π update on zenodo ui page * feat: β¨ delete branch after pr has been closed/merged * chore: π¨ spacing in changelog * wip: π§ individual validation requests for license and metadata * feat: β¨ license validation endpoint * wip: π§ creating updated metadata validation * wip: π§ patches for metadata revalidation workflow * wip: π§ validation for codemeta * doc: π jsdoc comments on fns * fix: π template renderer will stop using old links (#99) * fix: π rerender template will stop using old links * doc: π update CHANGELOG * doc: π update metadata * fix: π preserve authors and contributors from codemeta * feat: β¨ re-validated codemeta from repo dashboard * fix: π await metadata validation * feat: β¨ codemeta validation extended with microservice validator * refactor: β»οΈ update timestamps to be unix format * feat: β¨ clean privatekey env before use * refactor: β»οΈ update cwl validation endpoint * wip: π§ send validation message to db * feat: β¨ create migrations for metadata validation messages * wip: π§ creating json schema for codemeta.json validations * π· ci: setup deployment environments (#101) * π· ci: setup for staging env (#103) Co-authored-by: Sanjay Soundarajan <sanjay.16@live.com> Co-authored-by: slugb0t <wheresdorian@gmail.com> fix: π template renderer will stop using old links (#99) * fix: π adjust env variables used after env changes * π· ci: cleanup dockerfile * feat: β¨ codemeta schema first draft * π· ci: cleanup dockerfile * π· ci: cleanup dockerfile * π· ci: cleanup dockerfile * π· ci: setup for staging env * π· ci: setup for staging env * π· ci: setup for staging env * π· ci: setup for staging env * π· ci: cleanup dockerfile * π· ci: fix staging deploys (#104) * wip: π§ abstracting cwl workflow * refactor: β»οΈ update codemeta schema to validate against the raw codemeta.json files * refactor: β»οΈ update codemeta schema for additional fields * feat: β¨ validating raw content of codemeta.json file for 3.0 * refactor: β»οΈ create required fields for codemeta schema * wip: π§ testing validation responses for db * handle codemeta.json 3.0 and 2.0 versioning * fix: π correct branch watch for staging deployment action * doc: π update changelog for 3.2.0 release * feat: β¨ align bot prisma with ui * fix: π bug patch for cwl workflow * feat: β¨ metadata workflow update * refactor: β»οΈ preserving authors and contributors * wip: π§ update the metadata workflow after discussions * fix: π don't create cwlobject twice * refactor: β»οΈ send 200 status when invalid codemeta * refactor: β»οΈ update codemeta validation schema * refactor: β»οΈ do not revalidate metadata files for push events unless metadata files are updated themselves * wip: π§ seperate rerun validation with regather information * wip: π§ remove command from issue dashboard if error occurs (allows retry) * refactor: β»οΈ update the issue body after successful validation (remove the command from the issue body) * refactor: β»οΈ add additional key to codemeta schema * refactor: β»οΈ remove the regather options from the UI as validation is still needed when regathering * fix: π pr button updated with new links * fix: π patch variable declaration not in scope * refactor: β»οΈ update on the dropdown icons * refactor: β»οΈ update the keys of the cwl object * refactor: β»οΈ update the getcwlfiles function --------- Co-authored-by: Sanjay Soundarajan <sanjay.16@live.com> * fix: π use the correct env variable for private key * fix: π Codefair v3.2.0 finalization (#113) * fix: π correct cwlObject variables in push event * fix: π better error message in metadata workflow + collect missing fields from codemeta.json * fix: π apply await to async function call * refactor: β»οΈ removed unused imports * refactor: β»οΈ add try catch in then statement of promise * fix: π missing fields in codemeta gathering + add error handling for convertCitationForDB fn * refactor: β»οΈ add try catch to renderer to preserve errors * fix: π preserve metadata validation results in db * wip: π§ validation results being displayed through the repo dashboard * wip: π§ displaying metadata validation results in seperate pages * feat: β¨ validation page for codemeta * fix: π patch fundingCode not being preserved from codemeta * wip: π§ final design for validation results * feat: β¨ add view validation results conditionally * test: βοΈ ensuring validation progresses accordingly * feat: β¨ popover messages for metadata badges * feat: β¨ if metadata file fails to parse then update validation message * fix: π update schema to handle 2.0 and 3.0 authors * style: π¨ formatting * fix: π add releaseNotes key to schema for 3.0 versions * refactor: βοΈ change wording * fix: π validate metadata file that was updated only on push events * chore: π remove test logs * fix: π migrate db during deployment * fix: π revert * fix: π typo on dockerfile * refactor: β»οΈ use npm instead of yarn for migration * refactor: β»οΈ access db url during prisma build * refactor: β»οΈ apply node env * π ci: copy package json * π ci: revert arg * π ci: add prisma migrate to ci * π ci: add prisma migrate to ci * π· ci: update dockerfile * refactor: β»οΈ use deployed validator * fix: π when license is updated validate metadata files * fix: π validation returns codemeta version on errors * π fix: add basic logwatch * fix: π add @type key for 2.0 codemeta.json files * refactor: β»οΈ updated required fields for codemeta schmea * π fix: add logwatch support * π fix: add json to logwatch * fix: π patch json parse issue * fix: π update logging parameters * refactor: β»οΈ point a folder above for codemeta-schema * refactor: β»οΈ update dockerfile to include schema * fix: π ensure authors have roles key * refactor: β»οΈ π convert some consola logs to logwatch * fix: π roles are optional in save request * chore: π remove dev logs * doc: π update changelog * refactor: β»οΈ revert roles key being optional * fix: π add logwatch.start method * fix: π ensure contrib and authros have roles * fix: π CWL handles multiple installations * refactor: β»οΈ update log error * feat: β¨ purge zenodo token when sign in is required * fix: π make login fn asyncronous * refactor: π¨ update spacing and color of validation results button --------- Co-authored-by: Sanjay Soundarajan <sanjay.16@live.com> * chore: π Update CITATION.cff with Zenodo identifier * chore: π Update codemeta.json with Zenodo identifier * fix: π bad logwatch calls removed --------- Co-authored-by: Sanjay Soundarajan <sanjay.16@live.com> Co-authored-by: codefair-io[bot] <165336008+codefair-io[bot]@users.noreply.github.com> * refactor: β»οΈ π π π§βπ» Add Environment Variables and Convert Logging to Use Logwatch (#119) * dev: π§βπ» π add env variables for logwatch and validator * refactor: β»οΈ π replace consola with logwatch * doc: π update CHANGELOG --------- Co-authored-by: Sanjay Soundarajan <sanjay.16@live.com> Co-authored-by: codefair-io[bot] <165336008+codefair-io[bot]@users.noreply.github.com>
Summary by Sourcery
Refactor the logging system by replacing 'consola' with 'logwatch' for better log handling. Introduce new environment variables 'BOT_LOGWATCH_URL' and 'VALIDATOR_URL' to enhance configuration flexibility. Update CI workflows and deployment configurations to accommodate these changes.
Enhancements:
Build:
CI: