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

How To Set A Reporter For A Job? #507

Open
dinosaw opened this issue May 29, 2020 · 9 comments
Open

How To Set A Reporter For A Job? #507

dinosaw opened this issue May 29, 2020 · 9 comments

Comments

@dinosaw
Copy link

dinosaw commented May 29, 2020

Hello,

I am attempting to use the slack reporter. In the --edit-config file, I have set slack enabled to true and the webhook_url to the correct Slack URL. My question is now, how do I define it in the job? I don't see it described in the readthedocs documentation anywhere.

I tried something similar to the following syntax:

name: "Test 1"
url: "https://google.com/"
filter:
  - html2text:
      method: pyhtml2text
report:
  - slack:

But that doesn't seem to work. I don't know where in the job's configuration I'm supposed to tell it to use the Slack reporter. Can someone provide me an example template of what theirs looks like?

Additionally, is it expected to receive the following error when running --test-slack:

Error while submitting message to Slack:{"message": "Cannot send an empty message", "code": 50006}

Thanks!

@scottmac
Copy link
Contributor

The reporters aren't job specific, it would send to all reporters.

Are you submitting to discord instead of slack? I think that error message is from discord.

@thp
Copy link
Owner

thp commented Jul 21, 2020

Right now, reporters cannot be configured per-job. Closing as duplicate of #468.

@thp thp closed this as completed Jul 21, 2020
@thp
Copy link
Owner

thp commented Jul 29, 2020

Reopening and closing #468 instead.

@teeann
Copy link

teeann commented Dec 29, 2021

Is there any plan on resolving this? I think this use case is really essential for this tool.

@thp
Copy link
Owner

thp commented Dec 30, 2021

To quote from the other issue:

It can still be done by maintaining a separate config + job list and use --config and --urls with different invocations.

It might be essential for your use case (and you can work around it by specifying separate configs and url lists and running it for each set already now), but is not "essential for this tool". Different people use the tool differently.

For my use cases, I have a single reporter and multiple jobs, and that works just fine, and apparently this also applies to other users of this tool. I personally never had the need for setting different reporters for different jobs.

I'm sure that multiple people would welcome this change and have a use case for this, but this is not an "I'll scratch everyone's itch" project, it's an "I made this for myself, and if it's useful to anybody, that's great -- plus I'll accept pull requests if done well for things that other people might find useful and that fit the project's quality standards" project.

If you need this, feel free to implement it and send a pull request or if you don't have time or skills to implement it yourself, pay someone to do it for you.

In short, there's no plan on resolving this that I'm aware of at the moment. Patches gladly accepted.

@teeann
Copy link

teeann commented Dec 31, 2021

@thp Is it possible to add a FAQ section regarding this issue to the existing documentation?
It could save users some time digging through Github issues like this.

@KuleRucket
Copy link

If I use different instances with their own --config and --urls, do I also need to also use a different --cache file? I am not sure if they will clash somehow.

@neutric
Copy link
Contributor

neutric commented Feb 2, 2022

@KuleRucket If the jobs specified within the different --urls do not overlap for different --configs then there is no possibility for clashing. A job is identified in the database by guid, a hash of the value of its job-kind specific required key (e.g. command for shell-kind jobs). See https://urlwatch.readthedocs.io/en/latest/jobs.html#jobs for more info.

If you monitor the same job with different --configs, however, I believe that through differing job-specific defaults which influence the output of a job, such as e.g. the cookies key, you can create differing job output even though the source that is monitored does not change at all. That differing output would then be reported as change.

@KuleRucket
Copy link

KuleRucket commented Feb 2, 2022

EDIT: First answer removed.

Different guids, got it.

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

No branches or pull requests

6 participants