-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
ScheduleJob shorthand: Job name should match trigger name by default #1211
Comments
Thanks for the feedback, this is quite logical but also a breaking change, but again with GUID ids it doesn't make much of a breaking change until someone clashes with existing registration. Would you like to make a PR for this? |
@lahma Sure, I will make a PR. I notice that I'll have to add a few properties, so that logic can be performed from the sensible place, but I can keep them internal and get-only. |
@lahma I'm trying to add some unit tests to protect the new behavior going forward, but I'm running into the following issues:
As a result, I'm unable to add any unit tests on |
Adding a new reference is fine, also more permitting visibility modifiers if so needed. I don't think framework versions should be s limiting factor here. The internals visible was working at some point at least IIRC. |
Doing so, I run into this compiler error: Friend assembly reference 'Quartz.Tests.Unit' is invalid. Strong-name signed assemblies must specify a public key in their InternalsVisibleTo declarations. @lahma What do you suggest? Do you know how I can obtain the correct public key, or do we have another way to handle this? As a side note, I'm curious how a default interface implementation (which |
Now back at computer, easier to navigate the code. So there's already definitions for the InternalsVisibleTo, see AssemblyInfoExtras.cs. But I think as it's not referenced by DI project so you can just add link to that existing file. The public/private key pair can be found from Quartz.snk from repository root, if ever needed. I don' think |
I'm uncertain. I don't think you can specify an access modifier on regular (non-default) interface members. In other words, before default interface implementations, I believe such an access modifier would never compile. I could be mistaken. P.S. Meanwhile, I have circumvented the issue entirely, by simply making use of |
@lahma The PR is ready. It looks like I'm not permitted to push the feature branch, though. Or am I supposed to use a fork? |
@Timovzl please use a fork, it's quite standard way as I cannot allow full write access to this repo for everyone. Using a PR allows us to discuss the implementation. |
Thanks for the discussion and a great PR to improve things! |
Describe the bug
ScheduleJob is documented as a shorthand for
AddJob
plusAddTrigger
, and it is wonderful.Configuring the trigger is mandatory. Configuring the job is optional. It is, by far, the most readable to omit the job configuration - even the example in the docs omits it.
However, if no job name is explicitly specified, a UUID is generated for it. This seems like a poor default. Consider the example from the docs:
The trigger name will be "Combined Configuration Trigger". What should the job name be? I would infer that, considering what the shorthand was designed for in the first place, the job name should match the trigger name by default.
Version used
3.3.2.
To Reproduce
Simply implement the example from the docs.
Expected behavior
The job name (in the backing store) should equal the trigger name.
Additional Context
The only workaround we currently have is significantly uglier than the example, and seems to somewhat cancel out the benefits of the shorthand:
More importantly, it violates the DRY (Don't Repeat Yourself) principle. We could store the job name in a variable or constant, but that would require even more code.
The text was updated successfully, but these errors were encountered: