Skip Menu |

This queue is for tickets about the Artifactory-Client CPAN distribution.

Report information
The Basics
Id: 116647
Status: resolved
Priority: 0/
Queue: Artifactory-Client

People
Owner: Nobody in particular
Requestors: tony.monroe [...] adesa.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Repository API methods are awkward because they don't take repository as an argument
Date: Mon, 1 Aug 2016 14:51:48 -0700
To: <bug-Artifactory-Client [...] rt.cpan.org>
From: Tony Monroe <tony.monroe [...] adesa.com>
Specifically, I was hoping to do this: $client->calculate_yum_repository_metadata($repository, async => 1); But because I didn't construct my Artifactory::Client object with a specific repository from the beginning, I have to do some awkward workarounds involving _set_repository... my $prev_repo = $self->client->repository; $client->_set_repository($destination); $client->calculate_yum_repository_metadata(async => 1); $client->_set_repository($prev_repo); ...but you'd probably prefer I respected the API. Given the opportunity I would have, but this appears to be the most reasonable way of getting this done without using one of the generic methods (post, get, etc.). My application could possibly deal with multiple repositories across the lifetime of a single Artifactory::Client object, so restricting myself to one at object construction time is impractical. Perhaps the various methods dealing directly with repositories could be revised to take repositories as arguments. -- tony ************************************* The information transmitted herewith is confidential and sensitive information intended only for use to the individual or entity to which it is addressed. If the reader of this message is not the intended recipient, you are hereby notified that any review, retransmission, dissemination, distribution, copying or other use of, or taking of any action in reliance upon, this information is strictly prohibited. If you have received this communication in error, please contact the sender and delete the material from your computer. **************************************
Thanks for your suggestion. Would it make sense to provide optional parameter for repository, like so? $client->calculate_yum_repository_metadata(repository => $repository, async => 1); Something like this should be pretty easy to implement. Let me look into this next week. On Mon Aug 01 17:52:03 2016, tony.monroe@adesa.com wrote: Show quoted text
> Specifically, I was hoping to do this: > > $client->calculate_yum_repository_metadata($repository, async => 1); > > But because I didn't construct my Artifactory::Client object with a > specific repository from the beginning, I have to do some awkward > workarounds involving _set_repository... > > my $prev_repo = $self->client->repository; > $client->_set_repository($destination); > $client->calculate_yum_repository_metadata(async => 1); > $client->_set_repository($prev_repo); > > ...but you'd probably prefer I respected the API. Given the > opportunity > I would have, but this appears to be the most reasonable way of > getting > this done without using one of the generic methods (post, get, etc.). > > My application could possibly deal with multiple repositories across > the > lifetime of a single Artifactory::Client object, so restricting myself > to one at object construction time is impractical. > > Perhaps the various methods dealing directly with repositories could > be > revised to take repositories as arguments. > > -- tony > ************************************* > The information transmitted herewith is confidential and sensitive > information intended only for use to the individual or entity to which > it is addressed. If the reader of this message is not the intended > recipient, you are hereby notified that any review, retransmission, > dissemination, distribution, copying or other use of, or taking of any > action in reliance upon, this information is strictly prohibited. If > you have received this communication in error, please contact the > sender and delete the material from your computer. > **************************************
Subject: Re: [rt.cpan.org #116647] Repository API methods are awkward because they don't take repository as an argument
Date: Mon, 8 Aug 2016 08:29:34 -0700
To: <bug-Artifactory-Client [...] rt.cpan.org>
From: Tony Monroe <tony.monroe [...] adesa.com>
I think that is sensible. -- tony On 08/06/2016 10:40 AM, Satoshi Yagi via RT wrote: Show quoted text
> Thanks for your suggestion. Would it make sense to provide optional parameter for repository, like so? > $client->calculate_yum_repository_metadata(repository => $repository, async => 1);
************************************* The information transmitted herewith is confidential and sensitive information intended only for use to the individual or entity to which it is addressed. If the reader of this message is not the intended recipient, you are hereby notified that any review, retransmission, dissemination, distribution, copying or other use of, or taking of any action in reliance upon, this information is strictly prohibited. If you have received this communication in error, please contact the sender and delete the material from your computer. **************************************
Cool. Just to make sure, the repo name passed in via param should not persist, correct? That is, the override would need to happen per function-call basis and will not call _set_repository() method on the object. On Mon Aug 08 11:30:02 2016, tony.monroe@adesa.com wrote: Show quoted text
> I think that is sensible. > > -- tony > > On 08/06/2016 10:40 AM, Satoshi Yagi via RT wrote:
> > Thanks for your suggestion. Would it make sense to provide optional > > parameter for repository, like so? > > $client->calculate_yum_repository_metadata(repository => $repository, > > async => 1);
> ************************************* > The information transmitted herewith is confidential and sensitive > information intended only for use to the individual or entity to which > it is addressed. If the reader of this message is not the intended > recipient, you are hereby notified that any review, retransmission, > dissemination, distribution, copying or other use of, or taking of any > action in reliance upon, this information is strictly prohibited. If > you have received this communication in error, please contact the > sender and delete the material from your computer. > **************************************
Subject: Re: [rt.cpan.org #116647] Repository API methods are awkward because they don't take repository as an argument
Date: Tue, 9 Aug 2016 07:45:30 -0700
To: <bug-Artifactory-Client [...] rt.cpan.org>
From: Tony Monroe <tony.monroe [...] adesa.com>
On 08/08/2016 08:32 PM, Satoshi Yagi via RT wrote: Show quoted text
> > Cool. Just to make sure, the repo name passed in via param should not persist, correct? That is, the override would need to happen per function-call basis and will not call _set_repository() method on the object.
I would not expect it to persist. -- tony ************************************* The information transmitted herewith is confidential and sensitive information intended only for use to the individual or entity to which it is addressed. If the reader of this message is not the intended recipient, you are hereby notified that any review, retransmission, dissemination, distribution, copying or other use of, or taking of any action in reliance upon, this information is strictly prohibited. If you have received this communication in error, please contact the sender and delete the material from your computer. **************************************
I added repository => $repository overrides for calculate_* method calls, including calculate_yum_repository_metadata. Could you give 1.1.8 a try and see if it behaves how you'd expect? I'm planning to cover all method calls that work on a repository as well. On Tue Aug 09 15:57:33 2016, tony.monroe@adesa.com wrote: Show quoted text
> > > On 08/08/2016 08:32 PM, Satoshi Yagi via RT wrote:
> > > > Cool. Just to make sure, the repo name passed in via param should > > not persist, correct? That is, the override would need to happen per > > function-call basis and will not call _set_repository() method on the > > object.
> > I would not expect it to persist. > > -- tony > ************************************* > The information transmitted herewith is confidential and sensitive > information intended only for use to the individual or entity to which > it is addressed. If the reader of this message is not the intended > recipient, you are hereby notified that any review, retransmission, > dissemination, distribution, copying or other use of, or taking of any > action in reliance upon, this information is strictly prohibited. If > you have received this communication in error, please contact the > sender and delete the material from your computer. > **************************************
Added repository override for all methods that I could find that would take a repository in the path. Version 1.2.0 is released, please give it a try and reopen if it isn't behaving per your spec. On Tue Aug 09 23:44:29 2016, SYAGI wrote: Show quoted text
> I added repository => $repository overrides for calculate_* method > calls, including calculate_yum_repository_metadata. Could you give > 1.1.8 a try and see if it behaves how you'd expect? > > I'm planning to cover all method calls that work on a repository as > well. > > On Tue Aug 09 15:57:33 2016, tony.monroe@adesa.com wrote:
> > > > > > On 08/08/2016 08:32 PM, Satoshi Yagi via RT wrote:
> > > > > > Cool. Just to make sure, the repo name passed in via param should > > > not persist, correct? That is, the override would need to happen > > > per > > > function-call basis and will not call _set_repository() method on > > > the > > > object.
> > > > I would not expect it to persist. > > > > -- tony > > ************************************* > > The information transmitted herewith is confidential and sensitive > > information intended only for use to the individual or entity to > > which > > it is addressed. If the reader of this message is not the intended > > recipient, you are hereby notified that any review, retransmission, > > dissemination, distribution, copying or other use of, or taking of > > any > > action in reliance upon, this information is strictly prohibited. If > > you have received this communication in error, please contact the > > sender and delete the material from your computer. > > **************************************