wording in DependencyGraph

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

wording in DependencyGraph

Martin Ficker
Hello

I ran into a wording issue, that made it harder to understand what happens:
DependencyGraph has a method addDependency (AbstractProject from, AbstractProject to) (and some similair).
From the usage of the methods I assume it should be rather addDependency (to, from).
As far as I understand it like this:
If there exists a dependency from Project A to Project B this means:
- A needs B
- B should be build after A

Since my English is not to good I may be wrong...

Best regards,

Martin
Reply | Threaded
Open this post in threaded view
|

Re: wording in DependencyGraph

Kohsuke Kawaguchi
Administrator
Martin Ficker wrote:
> Hello
>
> I ran into a wording issue, that made it harder to understand what happens:
> DependencyGraph has a method addDependency (AbstractProject from,
> AbstractProject to) (and some similair).
>>From the usage of the methods I assume it should be rather addDependency
> (to, from).

Are you talking about whether the assignment target should be the first
argument or not? Let's not get there. You can line up examples in both
ways. It's bit like little endian vs big endian discussion.


> As far as I understand it like this:
> If there exists a dependency from Project A to Project B this means:
> - A needs B
> - B should be build after A

If A depends on B, that means A needs B, so B needs to be built before
A. Does that make sense?

>
> Since my English is not to good I may be wrong...
>
> Best regards,
>
> Martin
>


--
Kohsuke Kawaguchi
Sun Microsystems                   [hidden email]

smime.p7s (4K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: wording in DependencyGraph

Martin Ficker
Hi,

I don't care about  the order of the arguments, but about there names.
I'll try a more verbose example.
Image an Application MyApp. MyApp needs MyLogger to write Loggmessages.
Thats:

There exists a dependency from MyApp to MyLogger
A Build of MyLogger should trigger a build of MyApp.
In Hudsons words: MyApp is a downstream Project of MyLogger.

In the current implementation you would have to write
addDependency  (from = MyLogger, to = MyApp)

I beliebe it should be

addDependency (from  = MyApp, to = MyLogger)

Martin


Kohsuke Kawaguchi schrieb:

> Martin Ficker wrote:
>> Hello
>>
>> I ran into a wording issue, that made it harder to understand what
>> happens:
>> DependencyGraph has a method addDependency (AbstractProject from,
>> AbstractProject to) (and some similair).
>>> From the usage of the methods I assume it should be rather
>>> addDependency
>> (to, from).
>
> Are you talking about whether the assignment target should be the
> first argument or not? Let's not get there. You can line up examples
> in both ways. It's bit like little endian vs big endian discussion.
>
>
>> As far as I understand it like this:
>> If there exists a dependency from Project A to Project B this means:
>> - A needs B
>> - B should be build after A
>
> If A depends on B, that means A needs B, so B needs to be built before
> A. Does that make sense?
>
>>
>> Since my English is not to good I may be wrong...
>>
>> Best regards,
>>
>> Martin
>>
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: wording in DependencyGraph

Kohsuke Kawaguchi
Administrator
M. Ficker wrote:

> Hi,
>
> I don't care about  the order of the arguments, but about there names.
> I'll try a more verbose example.
> Image an Application MyApp. MyApp needs MyLogger to write Loggmessages.
> Thats:
>
> There exists a dependency from MyApp to MyLogger
> A Build of MyLogger should trigger a build of MyApp.
> In Hudsons words: MyApp is a downstream Project of MyLogger.
>
> In the current implementation you would have to write
> addDependency  (from = MyLogger, to = MyApp)
>
> I beliebe it should be
>
> addDependency (from  = MyApp, to = MyLogger)
And AFAICT, this is how it's done. The implementation is:

>     public void addDependency(AbstractProject from, AbstractProject to) {
>         if(built)
>             throw new IllegalStateException();
>         if(from==to)
>             return;
>         add(forward,from,to);
>         add(backward,to,from);
>     }

Am I missing something?

>
> Martin
>
>
> Kohsuke Kawaguchi schrieb:
>> Martin Ficker wrote:
>>> Hello
>>>
>>> I ran into a wording issue, that made it harder to understand what
>>> happens:
>>> DependencyGraph has a method addDependency (AbstractProject from,
>>> AbstractProject to) (and some similair).
>>>> From the usage of the methods I assume it should be rather
>>>> addDependency
>>> (to, from).
>>
>> Are you talking about whether the assignment target should be the
>> first argument or not? Let's not get there. You can line up examples
>> in both ways. It's bit like little endian vs big endian discussion.
>>
>>
>>> As far as I understand it like this:
>>> If there exists a dependency from Project A to Project B this means:
>>> - A needs B
>>> - B should be build after A
>>
>> If A depends on B, that means A needs B, so B needs to be built before
>> A. Does that make sense?
>>
>>>
>>> Since my English is not to good I may be wrong...
>>>
>>> Best regards,
>>>
>>> Martin
>>>
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>

--
Kohsuke Kawaguchi
Sun Microsystems                   [hidden email]

smime.p7s (4K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: wording in DependencyGraph

Martin Ficker
Kohsuke Kawaguchi schrieb:

> M. Ficker wrote:
>> Hi,
>>
>> I don't care about  the order of the arguments, but about there names.
>> I'll try a more verbose example.
>> Image an Application MyApp. MyApp needs MyLogger to write Loggmessages.
>> Thats:
>>
>> There exists a dependency from MyApp to MyLogger
>> A Build of MyLogger should trigger a build of MyApp.
>> In Hudsons words: MyApp is a downstream Project of MyLogger.
>>
>> In the current implementation you would have to write
>> addDependency  (from = MyLogger, to = MyApp)
>>
>> I beliebe it should be
>>
>> addDependency (from  = MyApp, to = MyLogger)
>
> And AFAICT, this is how it's done. The implementation is:
>
>>     public void addDependency(AbstractProject from, AbstractProject
>> to) {
>>         if(built)
>>             throw new IllegalStateException();
>>         if(from==to)
>>             return;
>>         add(forward,from,to);
>>         add(backward,to,from);
>>     }
>  
> Am I missing something?
The Implementation looks fine. The Trick is how the data in  'forward'
and 'backward' are interpreted.

You can see this from the Usage in BuildTrigger.buildDependencyGraphs:
graph.addDependency (owner, getChildProjects());
With Parameter names that means:
graph.addDependency (from = owner, to = getChildProjects());



>
>>
>> Martin
>>
>>
>> Kohsuke Kawaguchi schrieb:
>>> Martin Ficker wrote:
>>>> Hello
>>>>
>>>> I ran into a wording issue, that made it harder to understand what
>>>> happens:
>>>> DependencyGraph has a method addDependency (AbstractProject from,
>>>> AbstractProject to) (and some similair).
>>>>> From the usage of the methods I assume it should be rather
>>>>> addDependency
>>>> (to, from).
>>>
>>> Are you talking about whether the assignment target should be the
>>> first argument or not? Let's not get there. You can line up examples
>>> in both ways. It's bit like little endian vs big endian discussion.
>>>
>>>
>>>> As far as I understand it like this:
>>>> If there exists a dependency from Project A to Project B this means:
>>>> - A needs B
>>>> - B should be build after A
>>>
>>> If A depends on B, that means A needs B, so B needs to be built
>>> before A. Does that make sense?
>>>
>>>>
>>>> Since my English is not to good I may be wrong...
>>>>
>>>> Best regards,
>>>>
>>>> Martin
>>>>
>>>
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [hidden email]
>> For additional commands, e-mail: [hidden email]
>>
>>
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: wording in DependencyGraph

Kohsuke Kawaguchi
Administrator
M. Ficker wrote:

> Kohsuke Kawaguchi schrieb:
>> M. Ficker wrote:
>>> Hi,
>>>
>>> I don't care about  the order of the arguments, but about there names.
>>> I'll try a more verbose example.
>>> Image an Application MyApp. MyApp needs MyLogger to write Loggmessages.
>>> Thats:
>>>
>>> There exists a dependency from MyApp to MyLogger
>>> A Build of MyLogger should trigger a build of MyApp.
>>> In Hudsons words: MyApp is a downstream Project of MyLogger.
>>>
>>> In the current implementation you would have to write
>>> addDependency  (from = MyLogger, to = MyApp)
>>>
>>> I beliebe it should be
>>>
>>> addDependency (from  = MyApp, to = MyLogger)
>>
>> And AFAICT, this is how it's done. The implementation is:
>>
>>>     public void addDependency(AbstractProject from, AbstractProject
>>> to) {
>>>         if(built)
>>>             throw new IllegalStateException();
>>>         if(from==to)
>>>             return;
>>>         add(forward,from,to);
>>>         add(backward,to,from);
>>>     }
>>  
>> Am I missing something?
> The Implementation looks fine. The Trick is how the data in  'forward'
> and 'backward' are interpreted.
>
> You can see this from the Usage in BuildTrigger.buildDependencyGraphs:
> graph.addDependency (owner, getChildProjects());
> With Parameter names that means:
> graph.addDependency (from = owner, to = getChildProjects());
Again, I don't see what's wrong. This is setting up "build other
projects after this project is built" behavior. So surely the current
project is the "from" project and other child projects are the "to" project.


--
Kohsuke Kawaguchi
Sun Microsystems                   [hidden email]

smime.p7s (4K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: wording in DependencyGraph

Martin Ficker
Kohsuke Kawaguchi schrieb:

> M. Ficker wrote:
>> Kohsuke Kawaguchi schrieb:
>>> M. Ficker wrote:
>>>> Hi,
>>>>
>>>> I don't care about  the order of the arguments, but about there names.
>>>> I'll try a more verbose example.
>>>> Image an Application MyApp. MyApp needs MyLogger to write
>>>> Loggmessages.
>>>> Thats:
>>>>
>>>> There exists a dependency from MyApp to MyLogger
>>>> A Build of MyLogger should trigger a build of MyApp.
>>>> In Hudsons words: MyApp is a downstream Project of MyLogger.
>>>>
>>>> In the current implementation you would have to write
>>>> addDependency  (from = MyLogger, to = MyApp)
>>>>
>>>> I beliebe it should be
>>>>
>>>> addDependency (from  = MyApp, to = MyLogger)
>>>
>>> And AFAICT, this is how it's done. The implementation is:
>>>
>>>>     public void addDependency(AbstractProject from, AbstractProject
>>>> to) {
>>>>         if(built)
>>>>             throw new IllegalStateException();
>>>>         if(from==to)
>>>>             return;
>>>>         add(forward,from,to);
>>>>         add(backward,to,from);
>>>>     }
>>>  
>>> Am I missing something?
>> The Implementation looks fine. The Trick is how the data in  
>> 'forward' and 'backward' are interpreted.
>>
>> You can see this from the Usage in BuildTrigger.buildDependencyGraphs:
>> graph.addDependency (owner, getChildProjects());
>> With Parameter names that means:
>> graph.addDependency (from = owner, to = getChildProjects());
>
> Again, I don't see what's wrong. This is setting up "build other
> projects after this project is built" behavior. So surely the current
> project is the "from" project and other child projects are the "to"
> project.
>
>
I dont' think so.  MyApp ist a childProject of MyLogger. But MyLogger is
the dependency of MyApp. The Build Order is the reverse of the Dependeny
Order. So it would be
addDependency (from = MyApp (Thats the  ChildProject) , to = MyLogger
(thats the owner))






---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: wording in DependencyGraph

Kohsuke Kawaguchi
Administrator

I finally got it.

I renamed the 'from' parameter to upstream and the 'to' parameter to
downstream to avoid confusions.

M. Ficker wrote:

> Kohsuke Kawaguchi schrieb:
>> M. Ficker wrote:
>>> Kohsuke Kawaguchi schrieb:
>>>> M. Ficker wrote:
>>>>> Hi,
>>>>>
>>>>> I don't care about  the order of the arguments, but about there names.
>>>>> I'll try a more verbose example.
>>>>> Image an Application MyApp. MyApp needs MyLogger to write
>>>>> Loggmessages.
>>>>> Thats:
>>>>>
>>>>> There exists a dependency from MyApp to MyLogger
>>>>> A Build of MyLogger should trigger a build of MyApp.
>>>>> In Hudsons words: MyApp is a downstream Project of MyLogger.
>>>>>
>>>>> In the current implementation you would have to write
>>>>> addDependency  (from = MyLogger, to = MyApp)
>>>>>
>>>>> I beliebe it should be
>>>>>
>>>>> addDependency (from  = MyApp, to = MyLogger)
>>>>
>>>> And AFAICT, this is how it's done. The implementation is:
>>>>
>>>>>     public void addDependency(AbstractProject from, AbstractProject
>>>>> to) {
>>>>>         if(built)
>>>>>             throw new IllegalStateException();
>>>>>         if(from==to)
>>>>>             return;
>>>>>         add(forward,from,to);
>>>>>         add(backward,to,from);
>>>>>     }
>>>>  
>>>> Am I missing something?
>>> The Implementation looks fine. The Trick is how the data in  
>>> 'forward' and 'backward' are interpreted.
>>>
>>> You can see this from the Usage in BuildTrigger.buildDependencyGraphs:
>>> graph.addDependency (owner, getChildProjects());
>>> With Parameter names that means:
>>> graph.addDependency (from = owner, to = getChildProjects());
>>
>> Again, I don't see what's wrong. This is setting up "build other
>> projects after this project is built" behavior. So surely the current
>> project is the "from" project and other child projects are the "to"
>> project.
>>
>>
> I dont' think so.  MyApp ist a childProject of MyLogger. But MyLogger is
> the dependency of MyApp. The Build Order is the reverse of the Dependeny
> Order. So it would be
> addDependency (from = MyApp (Thats the  ChildProject) , to = MyLogger
> (thats the owner))

--
Kohsuke Kawaguchi
Sun Microsystems                   [hidden email]

smime.p7s (4K) Download Attachment