You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by Ian Boston <ie...@tfd.co.uk> on 2020/02/04 08:24:16 UTC

Re: Redirect Provider

Hi,
Which bundle/package should the API be in ?
Sling API ?
Best Regards
Ian

On Fri, 31 Jan 2020 at 17:50, Carsten Ziegeler <cz...@apache.org> wrote:

> A general service does imho not sense. That service has no knowledge
> about where resources are coming from and how binaries a stored.
> A resource provider does know these things.
>
> This leaves us with two options: we allow multiple services to be
> registered. Each service than has to check if it knows about the
> resource implementation it gets and if it knows about it, it can handle
> it. This makes handling this case unnecessarily complex. It also brings
> us back to an ordering problem - what if that service is currently not
> registered, but the resource provider is etc.
>
> The other option is to let the resource provider implementation provide
> this object. The only interface we have for this, is adaptTo. But as
> pointed out, in this case it is super safe to call adaptTo as the
> resource (or the backing resource provider) can implement it.
>
> No need to ask N services to find out that none of them supports a
> resource. No fear of services being temporarily unavailable etc.
>
> AdaptTo makes both, implementation and usage much cleaner
>
> Carsten
>
> On 31.01.2020 04:15, Ian Boston wrote:
> > Hi,
> > I started with that service pattern, as you have suggested, but Carsten
> > asked we used a provider with the adaptTo pattern. He can explain. He
> does
> > that better. It made sense to me when he did.
> > Best Regards
> > Ian
> >
> > On Fri, 31 Jan 2020 at 12:02, Radu Cotescu <ra...@apache.org> wrote:
> >
> >> Hi Ian,
> >>
> >> I posted a comment to your gist [2] where I just changed the pattern to
> >> not use adaptTo. WDYT?
> >>
> >> Thanks,
> >> Radu
> >>
> >> [2] -
> >>
> https://gist.github.com/ieb/5f217e2c160afb7bb4098bca99896621#gistcomment-3162233
> >> <
> >>
> https://gist.github.com/ieb/5f217e2c160afb7bb4098bca99896621#gistcomment-3162233
> >>>
> >
>
> --
> --
> Carsten Ziegeler
> Adobe Research Switzerland
> cziegeler@apache.org
>

Re: Redirect Provider

Posted by Robert Munteanu <ro...@apache.org>.
On Tue, 2020-02-04 at 10:14 +0100, Bertrand Delacretaz wrote:
> On Tue, Feb 4, 2020 at 9:54 AM Radu Cotescu <ra...@apache.org> wrote:
> > ...After Carsten’s detailed reasoning I guess it makes the most
> > sense to put this new
> > API in o.a.s.api, where the Resource and ResourceProvider APIs are
> > also defined...
> 
> But ideally in a new package? To avoid bumping up versions of
> existing
> packages, which often has unfortunate ripple effects.

+1

Robert


Re: Redirect Provider

Posted by Ian Boston <ie...@tfd.co.uk>.
Hi,
After discussing internally I have updated the patch to use and interface,
that hopefully will unblock the -1. The PR and issue has been reopened.
Best Regards
Ian

On Fri, 14 Feb 2020 at 15:06, Ian Boston <ie...@tfd.co.uk> wrote:

> Hi,
> The API PR attracted a -1 which I understand and respect.
>
> I cant see of a way or revolving the -1 without making the API
> unsupportable long term, hence I have closed the PRs and closed SLING-9060
> as a Wont fix and will look for alternative ways of solving the problem.
> Best Regards
> Ian
>
> On Mon, 10 Feb 2020 at 16:28, Ian Boston <ie...@tfd.co.uk> wrote:
>
>> > Let me know whether that is enough or it needs expansions.
>>
>> +1, works.
>>
>> Interestingly it did need all occurrences of bundles pointing to SNAPSHOT
>> Sling API bundles to be updated, and for those bundles to depend on the
>> latest snapshot of the API. scripting.core and servlets.resolver had to be
>> fixed before the tests would pass.
>>
>> Thanks for the comments on the PRs. I have tried to address them with
>> more commits.
>> Best Regards
>> Ian
>>
>> On Sat, 8 Feb 2020 at 12:18, Robert Munteanu <ro...@apache.org> wrote:
>>
>>> Hi Ian,
>>>
>>> On Sat, 2020-02-08 at 09:48 +0000, Ian Boston wrote:
>>> > Hi,
>>> > The PRs have been opened, see the issue.
>>> > I will do complete implementations to verify it works as required in
>>> > AEM.
>>> > I would also like to insure no disruption to Sling, and since it's
>>> > been a
>>> > long time since I did this, how do run full CI/CD and integrate a new
>>> > API
>>> > in Sling ? (a pointer would be great).
>>> >
>>>
>>> I have added some instructions at
>>>
>>>   https://sling.apache.org/contributing.html#testing
>>>
>>> Let me know whether that is enough or it needs expansions.
>>>
>>> Thanks,
>>> Robert
>>>
>>> > Best Regards
>>> > Ian
>>> >
>>> >
>>> > On Sat, 8 Feb 2020 at 09:23, Ian Boston <ie...@tfd.co.uk> wrote:
>>> >
>>> > > Hi,
>>> > > Opened [1] to track the work.
>>> > > Best Regards
>>> > > Ian
>>> > >
>>> > > 1 https://issues.apache.org/jira/browse/SLING-9060
>>> > >
>>> > > On Wed, 5 Feb 2020 at 22:12, Ian Boston <ie...@tfd.co.uk> wrote:
>>> > >
>>> > > > Hi,
>>> > > > Ok.
>>> > > >
>>> > > > o.a.s.api.redirect for the API, and a patch to the Get servlet to
>>> > > > use the
>>> > > > API.
>>> > > > Will do PRs shortly.
>>> > > >
>>> > > > Best Regards
>>> > > > Ian
>>> > > >
>>> > > >
>>> > > > On Tue, 4 Feb 2020 at 14:13, Bertrand Delacretaz <
>>> > > > bdelacretaz@apache.org>
>>> > > > wrote:
>>> > > >
>>> > > > > On Tue, Feb 4, 2020 at 1:58 PM Ian Boston <ie...@tfd.co.uk>
>>> > > > > wrote:
>>> > > > > > ...New package, agreed, no ripples.
>>> > > > > > o.a.s.api.response ? ...
>>> > > > >
>>> > > > > o.a.s.api.redirect is more specific and I think having packages
>>> > > > > with
>>> > > > > few interfaces is fine?
>>> > > > >
>>> > > > > The existing api.auth and api.security packages for example
>>> > > > > only have
>>> > > > > 3 items each.
>>> > > > >
>>> > > > > It has the benefit of OSGi package versioning being very
>>> > > > > specific.
>>> > > > >
>>> > > > > -Bertrand
>>> > > > >
>>>
>>>

Re: Redirect Provider

Posted by Ian Boston <ie...@tfd.co.uk>.
Hi,
The API PR attracted a -1 which I understand and respect.

I cant see of a way or revolving the -1 without making the API
unsupportable long term, hence I have closed the PRs and closed SLING-9060
as a Wont fix and will look for alternative ways of solving the problem.
Best Regards
Ian

On Mon, 10 Feb 2020 at 16:28, Ian Boston <ie...@tfd.co.uk> wrote:

> > Let me know whether that is enough or it needs expansions.
>
> +1, works.
>
> Interestingly it did need all occurrences of bundles pointing to SNAPSHOT
> Sling API bundles to be updated, and for those bundles to depend on the
> latest snapshot of the API. scripting.core and servlets.resolver had to be
> fixed before the tests would pass.
>
> Thanks for the comments on the PRs. I have tried to address them with more
> commits.
> Best Regards
> Ian
>
> On Sat, 8 Feb 2020 at 12:18, Robert Munteanu <ro...@apache.org> wrote:
>
>> Hi Ian,
>>
>> On Sat, 2020-02-08 at 09:48 +0000, Ian Boston wrote:
>> > Hi,
>> > The PRs have been opened, see the issue.
>> > I will do complete implementations to verify it works as required in
>> > AEM.
>> > I would also like to insure no disruption to Sling, and since it's
>> > been a
>> > long time since I did this, how do run full CI/CD and integrate a new
>> > API
>> > in Sling ? (a pointer would be great).
>> >
>>
>> I have added some instructions at
>>
>>   https://sling.apache.org/contributing.html#testing
>>
>> Let me know whether that is enough or it needs expansions.
>>
>> Thanks,
>> Robert
>>
>> > Best Regards
>> > Ian
>> >
>> >
>> > On Sat, 8 Feb 2020 at 09:23, Ian Boston <ie...@tfd.co.uk> wrote:
>> >
>> > > Hi,
>> > > Opened [1] to track the work.
>> > > Best Regards
>> > > Ian
>> > >
>> > > 1 https://issues.apache.org/jira/browse/SLING-9060
>> > >
>> > > On Wed, 5 Feb 2020 at 22:12, Ian Boston <ie...@tfd.co.uk> wrote:
>> > >
>> > > > Hi,
>> > > > Ok.
>> > > >
>> > > > o.a.s.api.redirect for the API, and a patch to the Get servlet to
>> > > > use the
>> > > > API.
>> > > > Will do PRs shortly.
>> > > >
>> > > > Best Regards
>> > > > Ian
>> > > >
>> > > >
>> > > > On Tue, 4 Feb 2020 at 14:13, Bertrand Delacretaz <
>> > > > bdelacretaz@apache.org>
>> > > > wrote:
>> > > >
>> > > > > On Tue, Feb 4, 2020 at 1:58 PM Ian Boston <ie...@tfd.co.uk>
>> > > > > wrote:
>> > > > > > ...New package, agreed, no ripples.
>> > > > > > o.a.s.api.response ? ...
>> > > > >
>> > > > > o.a.s.api.redirect is more specific and I think having packages
>> > > > > with
>> > > > > few interfaces is fine?
>> > > > >
>> > > > > The existing api.auth and api.security packages for example
>> > > > > only have
>> > > > > 3 items each.
>> > > > >
>> > > > > It has the benefit of OSGi package versioning being very
>> > > > > specific.
>> > > > >
>> > > > > -Bertrand
>> > > > >
>>
>>

Re: Redirect Provider

Posted by Ian Boston <ie...@tfd.co.uk>.
> Let me know whether that is enough or it needs expansions.

+1, works.

Interestingly it did need all occurrences of bundles pointing to SNAPSHOT
Sling API bundles to be updated, and for those bundles to depend on the
latest snapshot of the API. scripting.core and servlets.resolver had to be
fixed before the tests would pass.

Thanks for the comments on the PRs. I have tried to address them with more
commits.
Best Regards
Ian

On Sat, 8 Feb 2020 at 12:18, Robert Munteanu <ro...@apache.org> wrote:

> Hi Ian,
>
> On Sat, 2020-02-08 at 09:48 +0000, Ian Boston wrote:
> > Hi,
> > The PRs have been opened, see the issue.
> > I will do complete implementations to verify it works as required in
> > AEM.
> > I would also like to insure no disruption to Sling, and since it's
> > been a
> > long time since I did this, how do run full CI/CD and integrate a new
> > API
> > in Sling ? (a pointer would be great).
> >
>
> I have added some instructions at
>
>   https://sling.apache.org/contributing.html#testing
>
> Let me know whether that is enough or it needs expansions.
>
> Thanks,
> Robert
>
> > Best Regards
> > Ian
> >
> >
> > On Sat, 8 Feb 2020 at 09:23, Ian Boston <ie...@tfd.co.uk> wrote:
> >
> > > Hi,
> > > Opened [1] to track the work.
> > > Best Regards
> > > Ian
> > >
> > > 1 https://issues.apache.org/jira/browse/SLING-9060
> > >
> > > On Wed, 5 Feb 2020 at 22:12, Ian Boston <ie...@tfd.co.uk> wrote:
> > >
> > > > Hi,
> > > > Ok.
> > > >
> > > > o.a.s.api.redirect for the API, and a patch to the Get servlet to
> > > > use the
> > > > API.
> > > > Will do PRs shortly.
> > > >
> > > > Best Regards
> > > > Ian
> > > >
> > > >
> > > > On Tue, 4 Feb 2020 at 14:13, Bertrand Delacretaz <
> > > > bdelacretaz@apache.org>
> > > > wrote:
> > > >
> > > > > On Tue, Feb 4, 2020 at 1:58 PM Ian Boston <ie...@tfd.co.uk>
> > > > > wrote:
> > > > > > ...New package, agreed, no ripples.
> > > > > > o.a.s.api.response ? ...
> > > > >
> > > > > o.a.s.api.redirect is more specific and I think having packages
> > > > > with
> > > > > few interfaces is fine?
> > > > >
> > > > > The existing api.auth and api.security packages for example
> > > > > only have
> > > > > 3 items each.
> > > > >
> > > > > It has the benefit of OSGi package versioning being very
> > > > > specific.
> > > > >
> > > > > -Bertrand
> > > > >
>
>

Re: Redirect Provider

Posted by Robert Munteanu <ro...@apache.org>.
Hi Ian,

On Sat, 2020-02-08 at 09:48 +0000, Ian Boston wrote:
> Hi,
> The PRs have been opened, see the issue.
> I will do complete implementations to verify it works as required in
> AEM.
> I would also like to insure no disruption to Sling, and since it's
> been a
> long time since I did this, how do run full CI/CD and integrate a new
> API
> in Sling ? (a pointer would be great).
> 

I have added some instructions at 

  https://sling.apache.org/contributing.html#testing

Let me know whether that is enough or it needs expansions.

Thanks,
Robert

> Best Regards
> Ian
> 
> 
> On Sat, 8 Feb 2020 at 09:23, Ian Boston <ie...@tfd.co.uk> wrote:
> 
> > Hi,
> > Opened [1] to track the work.
> > Best Regards
> > Ian
> > 
> > 1 https://issues.apache.org/jira/browse/SLING-9060
> > 
> > On Wed, 5 Feb 2020 at 22:12, Ian Boston <ie...@tfd.co.uk> wrote:
> > 
> > > Hi,
> > > Ok.
> > > 
> > > o.a.s.api.redirect for the API, and a patch to the Get servlet to
> > > use the
> > > API.
> > > Will do PRs shortly.
> > > 
> > > Best Regards
> > > Ian
> > > 
> > > 
> > > On Tue, 4 Feb 2020 at 14:13, Bertrand Delacretaz <
> > > bdelacretaz@apache.org>
> > > wrote:
> > > 
> > > > On Tue, Feb 4, 2020 at 1:58 PM Ian Boston <ie...@tfd.co.uk>
> > > > wrote:
> > > > > ...New package, agreed, no ripples.
> > > > > o.a.s.api.response ? ...
> > > > 
> > > > o.a.s.api.redirect is more specific and I think having packages
> > > > with
> > > > few interfaces is fine?
> > > > 
> > > > The existing api.auth and api.security packages for example
> > > > only have
> > > > 3 items each.
> > > > 
> > > > It has the benefit of OSGi package versioning being very
> > > > specific.
> > > > 
> > > > -Bertrand
> > > > 


Re: Redirect Provider

Posted by Ian Boston <ie...@tfd.co.uk>.
Hi,
The PRs have been opened, see the issue.
I will do complete implementations to verify it works as required in AEM.
I would also like to insure no disruption to Sling, and since it's been a
long time since I did this, how do run full CI/CD and integrate a new API
in Sling ? (a pointer would be great).
Best Regards
Ian


On Sat, 8 Feb 2020 at 09:23, Ian Boston <ie...@tfd.co.uk> wrote:

> Hi,
> Opened [1] to track the work.
> Best Regards
> Ian
>
> 1 https://issues.apache.org/jira/browse/SLING-9060
>
> On Wed, 5 Feb 2020 at 22:12, Ian Boston <ie...@tfd.co.uk> wrote:
>
>> Hi,
>> Ok.
>>
>> o.a.s.api.redirect for the API, and a patch to the Get servlet to use the
>> API.
>> Will do PRs shortly.
>>
>> Best Regards
>> Ian
>>
>>
>> On Tue, 4 Feb 2020 at 14:13, Bertrand Delacretaz <bd...@apache.org>
>> wrote:
>>
>>> On Tue, Feb 4, 2020 at 1:58 PM Ian Boston <ie...@tfd.co.uk> wrote:
>>> > ...New package, agreed, no ripples.
>>> > o.a.s.api.response ? ...
>>>
>>> o.a.s.api.redirect is more specific and I think having packages with
>>> few interfaces is fine?
>>>
>>> The existing api.auth and api.security packages for example only have
>>> 3 items each.
>>>
>>> It has the benefit of OSGi package versioning being very specific.
>>>
>>> -Bertrand
>>>
>>

Re: Redirect Provider

Posted by Ian Boston <ie...@tfd.co.uk>.
Hi,
Opened [1] to track the work.
Best Regards
Ian

1 https://issues.apache.org/jira/browse/SLING-9060

On Wed, 5 Feb 2020 at 22:12, Ian Boston <ie...@tfd.co.uk> wrote:

> Hi,
> Ok.
>
> o.a.s.api.redirect for the API, and a patch to the Get servlet to use the
> API.
> Will do PRs shortly.
>
> Best Regards
> Ian
>
>
> On Tue, 4 Feb 2020 at 14:13, Bertrand Delacretaz <bd...@apache.org>
> wrote:
>
>> On Tue, Feb 4, 2020 at 1:58 PM Ian Boston <ie...@tfd.co.uk> wrote:
>> > ...New package, agreed, no ripples.
>> > o.a.s.api.response ? ...
>>
>> o.a.s.api.redirect is more specific and I think having packages with
>> few interfaces is fine?
>>
>> The existing api.auth and api.security packages for example only have
>> 3 items each.
>>
>> It has the benefit of OSGi package versioning being very specific.
>>
>> -Bertrand
>>
>

Re: Redirect Provider

Posted by Ian Boston <ie...@tfd.co.uk>.
Hi,
Ok.

o.a.s.api.redirect for the API, and a patch to the Get servlet to use the
API.
Will do PRs shortly.

Best Regards
Ian


On Tue, 4 Feb 2020 at 14:13, Bertrand Delacretaz <bd...@apache.org>
wrote:

> On Tue, Feb 4, 2020 at 1:58 PM Ian Boston <ie...@tfd.co.uk> wrote:
> > ...New package, agreed, no ripples.
> > o.a.s.api.response ? ...
>
> o.a.s.api.redirect is more specific and I think having packages with
> few interfaces is fine?
>
> The existing api.auth and api.security packages for example only have
> 3 items each.
>
> It has the benefit of OSGi package versioning being very specific.
>
> -Bertrand
>

Re: Redirect Provider

Posted by Bertrand Delacretaz <bd...@apache.org>.
On Tue, Feb 4, 2020 at 1:58 PM Ian Boston <ie...@tfd.co.uk> wrote:
> ...New package, agreed, no ripples.
> o.a.s.api.response ? ...

o.a.s.api.redirect is more specific and I think having packages with
few interfaces is fine?

The existing api.auth and api.security packages for example only have
3 items each.

It has the benefit of OSGi package versioning being very specific.

-Bertrand

Re: Redirect Provider

Posted by Ian Boston <ie...@tfd.co.uk>.
Hi,
New package, agreed, no ripples.

o.a.s.api.response ?

request & resource already exist, but no response.
Best Regards
Ian



On Tue, 4 Feb 2020 at 10:14, Bertrand Delacretaz <bd...@apache.org>
wrote:

> On Tue, Feb 4, 2020 at 9:54 AM Radu Cotescu <ra...@apache.org> wrote:
> > ...After Carsten’s detailed reasoning I guess it makes the most sense to
> put this new
> > API in o.a.s.api, where the Resource and ResourceProvider APIs are also
> defined...
>
> But ideally in a new package? To avoid bumping up versions of existing
> packages, which often has unfortunate ripple effects.
>
> -Bertrand
>

Re: Redirect Provider

Posted by Bertrand Delacretaz <bd...@apache.org>.
On Tue, Feb 4, 2020 at 9:54 AM Radu Cotescu <ra...@apache.org> wrote:
> ...After Carsten’s detailed reasoning I guess it makes the most sense to put this new
> API in o.a.s.api, where the Resource and ResourceProvider APIs are also defined...

But ideally in a new package? To avoid bumping up versions of existing
packages, which often has unfortunate ripple effects.

-Bertrand

Re: Redirect Provider

Posted by Radu Cotescu <ra...@apache.org>.
Hi Ian,

> On 4 Feb 2020, at 09:24, Ian Boston <ie...@tfd.co.uk> wrote:
> 
> Hi,
> Which bundle/package should the API be in ?
> Sling API ?
> Best Regards
> Ian
> 

After Carsten’s detailed reasoning I guess it makes the most sense to put this new API in o.a.s.api, where the Resource and ResourceProvider APIs are also defined.

Regards,
Radu