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

Add logging to project automations #3404

Merged
merged 19 commits into from
Dec 19, 2023
Merged

Conversation

Proibito04
Copy link
Contributor

Fixes

Fixes #3396 by @dhruvkb

Description

This pull request adds detailed console.log statements for improved debugging in issues.mjs and prs.mjs, enhancing visibility in GitHub Actions workflows.

Checklist

  • My pull request has a descriptive title (not a vague title likeUpdate index.md).
  • My pull request targets the default branch of the repository (main) or a parent feature branch.
  • My commit messages follow best practices.
  • My code follows the established code style of the repository.
  • I added or updated tests for the changes I made (if applicable).
  • I added or updated documentation (if applicable).
  • I tried running the project locally and verified that there are no visible errors.
  • I ran the DAG documentation generator (if applicable).

Developer Certificate of Origin

Developer Certificate of Origin
Developer Certificate of Origin
Version 1.1

Copyright (C) 2004, 2006 The Linux Foundation and its contributors.
1 Letterman Drive
Suite D4700
San Francisco, CA, 94129

Everyone is permitted to copy and distribute verbatim copies of this
license document, but changing it is not allowed.


Developer's Certificate of Origin 1.1

By making a contribution to this project, I certify that:

(a) The contribution was created in whole or in part by me and I
    have the right to submit it under the open source license
    indicated in the file; or

(b) The contribution is based upon previous work that, to the best
    of my knowledge, is covered under an appropriate open source
    license and I have the right under that license to submit that
    work with modifications, whether created in whole or in part
    by me, under the same open source license (unless I am
    permitted to submit under a different license), as indicated
    in the file; or

(c) The contribution was provided directly to me by some other
    person who certified (a), (b) or (c) and I have not modified
    it.

(d) I understand and agree that this project and the contribution
    are public and that a record of the contribution (including all
    personal information I submit with it, including my sign-off) is
    maintained indefinitely and may be redistributed consistent with
    this project or the open source license(s) involved.

@Proibito04 Proibito04 requested a review from a team as a code owner November 27, 2023 16:46
@openverse-bot openverse-bot added 🟩 priority: low Low priority and doesn't need to be rushed ✨ goal: improvement Improvement to an existing user-facing feature 🤖 aspect: dx Concerns developers' experience with the codebase 🚦 status: awaiting triage Has not been triaged & therefore, not ready for work labels Nov 27, 2023
@dhruvkb dhruvkb added 🧱 stack: mgmt Related to repo management and automations and removed 🚦 status: awaiting triage Has not been triaged & therefore, not ready for work labels Nov 27, 2023
Copy link
Member

@dhruvkb dhruvkb left a comment

Choose a reason for hiding this comment

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

@Proibito04 from a cursory reading, it seems great work, thank you for the contribution! I do have a few notes.

  • The Lint check is failing, which indicates that your code diverges from the style guide. You can examine the output of the Lint check to determine what needs to be fixed.
  • Debug logs are not visible in the GitHub UI unless the action is being re-run with debug level logging. Thus you should make some progress tracking logs higher level than debug so that they always show up.
  • Since we are running these workflows inside actions/github-script, we can use the @actions/core package (can be passed as an arg to the main function) to write logs that will automatically handle the relevant ::_:: prefix.
  • Some of the logs that are often repeated adjacent to a function or util can be moved into that function or util class itself. That will significant DRY up the code changes.

automations/js/src/project_automation/issues.mjs Outdated Show resolved Hide resolved
automations/js/src/project_automation/issues.mjs Outdated Show resolved Hide resolved
automations/js/src/project_automation/issues.mjs Outdated Show resolved Hide resolved
automations/js/src/project_automation/issues.mjs Outdated Show resolved Hide resolved
@Proibito04
Copy link
Contributor Author

@dhruvkb, thank you for your suggestions. I've removed the imports and passed core through the function parameters. I've also streamlined the code by moving numerous debug statements into moveCard

@Proibito04 Proibito04 requested a review from dhruvkb November 30, 2023 10:40
Copy link
Member

@dhruvkb dhruvkb left a comment

Choose a reason for hiding this comment

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

This is a huge improvement, and thanks for constantly iterating on feedback! I want to emphasise that this is incredible as it is and we're only iterating on nit picks and minor implementation details now.

But as always, there is scope for more refinement. I've listed down some ideas as comments below. I hope you don't mind more iterations but if you do, please let us know and we'll be happy to apply the finishing touches and merge it.

I also made some changes to your code as an example with explanations below each change. If you could apply them in other areas, that would be awesome.

.github/workflows/pr_automations.yml Outdated Show resolved Hide resolved
automations/js/src/utils/projects.mjs Outdated Show resolved Hide resolved
automations/js/src/utils/projects.mjs Show resolved Hide resolved
automations/js/src/utils/projects.mjs Show resolved Hide resolved
automations/js/src/utils/projects.mjs Show resolved Hide resolved
automations/js/src/project_automation/issues.mjs Outdated Show resolved Hide resolved
automations/js/src/project_automation/issues.mjs Outdated Show resolved Hide resolved
automations/js/src/project_automation/issues.mjs Outdated Show resolved Hide resolved
automations/js/src/project_automation/issues.mjs Outdated Show resolved Hide resolved
Proibito04 and others added 3 commits December 2, 2023 01:13
- Implemented core in Project class.
- Removed core from moveCard functions.
- Added core integration in YAML configurations.
@openverse-bot
Copy link
Collaborator

Based on the low urgency of this PR, the following reviewers are being gently reminded to review this PR:

@obulat
@sarayourfriend
This reminder is being automatically generated due to the urgency configuration.

Excluding weekend1 days, this PR was ready for review 5 day(s) ago. PRs labelled with low urgency are expected to be reviewed within 5 weekday(s)2.

@Proibito04, if this PR is not ready for a review, please draft it to prevent reviewers from getting further unnecessary pings.

Footnotes

  1. Specifically, Saturday and Sunday.

  2. For the purpose of these reminders we treat Monday - Friday as weekdays. Please note that the operation that generates these reminders runs at midnight UTC on Monday - Friday. This means that depending on your timezone, you may be pinged outside of the expected range.

@dhruvkb dhruvkb marked this pull request as draft December 5, 2023 00:27
@dhruvkb dhruvkb marked this pull request as ready for review December 14, 2023 10:02
Copy link
Contributor

@obulat obulat left a comment

Choose a reason for hiding this comment

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

Thank you for your contribution, @Proibito04, great work!

@dhruvkb dhruvkb changed the title Add detailed console.log statements for enhanced debugging in GitHu… Add logging to project automations Dec 19, 2023
@dhruvkb dhruvkb merged commit 8cd1dbc into WordPress:main Dec 19, 2023
45 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🤖 aspect: dx Concerns developers' experience with the codebase ✨ goal: improvement Improvement to an existing user-facing feature 🟩 priority: low Low priority and doesn't need to be rushed 🧱 stack: mgmt Related to repo management and automations
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Add logging to project automations
4 participants