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

Improve Cloudflare Worker postComment metadata #34

Closed
gentlementlegen opened this issue Oct 30, 2024 · 18 comments · Fixed by ubiquity-os-marketplace/command-query#18
Closed

Comments

@gentlementlegen
Copy link
Member

gentlementlegen commented Oct 30, 2024

          @whilefoo A thing we could do for Workers is to put the url to the logs, that would look like

https://dash.cloudflare.com/${env.CLOUDFLARE_ACCOUNT_ID}/workers/services/view/${env.CLOUDFLARE_WORKER_NAME}/production/observability/logs?granularity=0&time=${timeParam}

However this would require worker deployments to upload these values as they are not accessible through a worker by default. What do you think?

If yes, it should be its own task I believe.

Originally posted by @gentlementlegen in ubiquity-os/ubiquity-os-kernel#169 (comment)

postComment can post the url for an Action worker, but doesn't not have context for a Worker run. What could be done is adding a url to the dashboard with the time of the run as a filter so that we instantly have the related logs displayed.

Code snippet:

const toTime = Date.now() + 60000;
    const fromTime = Date.now() - 60000;
    const timeParam = encodeURIComponent(`{"type":"absolute","to":${toTime},"from":${fromTime}}`);

    console.log(
      `https://dash.cloudflare.com/${env.CLOUDFLARE_ACCOUNT_ID}/workers/services/view/${env.CLOUDFLARE_WORKER_NAME}/production/observability/logs?granularity=0&time=${timeParam}`
    );

This would imply uploading CLOUDFLARE_ACCOUNT_ID and CLOUDFLARE_WORKER_NAME during worker deployment as these values are not available by default.

To achieve this, a new reusable GitHub action could be created to avoid having to modify each upload script from every worker plugin. This would greatly benefit all the projects and make deployment simpler.

@gentlementlegen gentlementlegen changed the title @whilefoo A thing we could do for Workers is to put the url to the logs, that would look like Improve Cloudflare Worker postComment metadata Oct 30, 2024
@gentlementlegen
Copy link
Member Author

/help

Copy link

ubiquity-os bot commented Oct 30, 2024

Available Commands

Command Description Example
/help List all available commands. /help

Copy link

Available Commands

Command Description Example
/help List all available commands. /help
/allow Allows the user to modify the given label. /allow @user1 label
/query Returns the user's wallet, access, and multiplier information. /query @UbiquityOS
/start Assign yourself to the issue. /start
/stop Unassign yourself from the issue. /stop
/wallet Register your wallet address for payments. /wallet ubq.eth

@gentlementlegen
Copy link
Member Author

/start @Keyrxng

Copy link

Deadline Wed, Nov 6, 8:20 AM UTC
Beneficiary 0x0fC1b909ba9265A846b82CF4CE352fc3e7EeB2ED

Tip

  • Use /wallet 0x0000...0000 if you want to update your registered payment wallet address.
  • Be sure to open a draft pull request as soon as possible to communicate updates on your progress.
  • Be sure to provide timely updates to us when requested, or you will be automatically unassigned from the task.

@gentlementlegen
Copy link
Member Author

@Keyrxng Tried to start it for you but something didn't go as expected, maybe because you're not part of this repository, please start when you can.

@gentlementlegen gentlementlegen removed their assignment Nov 6, 2024
@Keyrxng
Copy link

Keyrxng commented Nov 6, 2024

/start

Copy link

Deadline Wed, Nov 6, 9:37 AM UTC
Beneficiary 0xAe5D1F192013db889b1e2115A370aB133f359765

Tip

  • Use /wallet 0x0000...0000 if you want to update your registered payment wallet address.
  • Be sure to open a draft pull request as soon as possible to communicate updates on your progress.
  • Be sure to provide timely updates to us when requested, or you will be automatically unassigned from the task.

Copy link

Passed the deadline and no activity is detected, removing assignees: @Keyrxng.

@Keyrxng
Copy link

Keyrxng commented Nov 23, 2024

This should be transferred into https://github.com/ubiquity-os/plugin-sdk

Also when this is labelled I'm happy to re-sub the PR

@sura1-0-1
Copy link

/help

Copy link

Available Commands

Command Description Example
/help List all available commands. /help
/allow Allows the user to modify the given label type. /allow @user1 label
/ask Ask any question about the repository, issue or pull request /ask
/query Returns the user's wallet, access, and multiplier information. /query @UbiquityOS
/start Assign yourself and/or others to the issue/task. /start
/stop Unassign yourself from the issue/task. /stop
/wallet Register your wallet address for payments. Use '/wallet unset' to unlink your wallet. /wallet ubq.eth

@sura1-0-1
Copy link

/wallet 0x6C4E0B11704228B338A383380b6415453A30278f

Copy link

+ Successfully set wallet

@sura1-0-1
Copy link

/start

Copy link

! This task does not reflect a business priority at the moment. You may start tasks with one of the following labels: Priority: 3 (High), Priority: 4 (Urgent), Priority: 5 (Emergency)

@gentlementlegen
Copy link
Member Author

To be completed, this would need #41 to be completed, then updating plugins that run as workers.

Copy link

ubiquity-os-beta bot commented Jan 7, 2025

 [ 117.39 WXDAI ] 

@gentlementlegen
Contributions Overview
ViewContributionCountReward
IssueTask1100
IssueSpecification117.39
ReviewComment10
Conversation Incentives
CommentFormattingRelevancePriorityReward
@whilefoo A thing we could do for Workers is to put the url to t…
17.39
content:
  content:
    p:
      score: 0
      elementCount: 9
    em:
      score: 0
      elementCount: 1
    a:
      score: 5
      elementCount: 2
  result: 10
regex:
  wordCount: 158
  wordValue: 0.1
  result: 7.39
1117.39
Resolves https://github.com/ubiquity-os/plugin-sdk/issues/34QA…
10
content:
  content:
    p:
      score: 0
      elementCount: 2
    a:
      score: 5
      elementCount: 2
  result: 10
regex:
  wordCount: 2
  wordValue: 0
  result: 0
0.410

 [ 0.77 WXDAI ] 

@Keyrxng
Contributions Overview
ViewContributionCountReward
IssueComment10.77
ReviewComment20
Conversation Incentives
CommentFormattingRelevancePriorityReward
This should be transferred into https://github.com/ubiquity-os/p…
6.17
content:
  content:
    p:
      score: 0
      elementCount: 2
    a:
      score: 5
      elementCount: 1
  result: 5
regex:
  wordCount: 18
  wordValue: 0.1
  result: 1.17
0.510.77
if this is for the worker log url: wasn't the plan was to implem…
0
content:
  content:
    p:
      score: 0
      elementCount: 1
  result: 0
regex:
  wordCount: 34
  wordValue: 0
  result: 0
0.810
gotcha npnp
0
content:
  content:
    p:
      score: 0
      elementCount: 1
  result: 0
regex:
  wordCount: 2
  wordValue: 0
  result: 0
0.210

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants