Metacello configuration based on subdirectory of Git repo

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Metacello configuration based on subdirectory of Git repo

Rafael Luque
Hi all,

I'm starting with Pharo and playing with the ways to integrate it with Git.

I've read the "Git and Pharo" chapter on "Enterprise Pharo" book by Thierry Goubier and loaded the GitFileTree package.

I'm working on a project with several microservices, one of them will be based on Pharo and the other ones in other technologies. The project repository is based in our own Git server and each microservice maps with one subdirectory in the repo.

My question is if it is possible to define a Metacello configuration to load my packages from an specific subdirectory of a Git repository. I have tried with the following baseline method, but it fails because does not understand repoPath:

baseline01: spec
<version: '0.1-baseline'>
spec
for: #common
do: [ 
spec blessing: #baseline.
spec repository: 'git@my-git-server:my-project'.
                        spec repoPath: 'my-pharo-subdirectory'.
spec
package: 'MyPackage'.
                        . . . ]

Thank you in advance.

Reply | Threaded
Open this post in threaded view
|

Re: Metacello configuration based on subdirectory of Git repo

Dale Henrichs-3
Rafael,

To get to a git repository use a filetree repository and point to a local clone of the repo.  I've editted your baseline accordingly:

baseline01: spec
<version: '0.1-baseline'>
spec
for: #common
do: [ 
spec blessing: #baseline.
spec repository: 'filetree://full-filesystempath-to-your-pharo-subdirectory'.
spec
package: 'MyPackage'.
                        . . . ]

If you hafve a project on github or bitbucket you can reference the repository directly (readonly) with the following url:

  github://github_username/github_projectname:branch_SHA_tag/path_to_subdirctory

for bitbucket, you just use bitbucket: instead.

Dale

On Thu, Nov 13, 2014 at 9:21 AM, Rafael Luque <[hidden email]> wrote:
Hi all,

I'm starting with Pharo and playing with the ways to integrate it with Git.

I've read the "Git and Pharo" chapter on "Enterprise Pharo" book by Thierry Goubier and loaded the GitFileTree package.

I'm working on a project with several microservices, one of them will be based on Pharo and the other ones in other technologies. The project repository is based in our own Git server and each microservice maps with one subdirectory in the repo.

My question is if it is possible to define a Metacello configuration to load my packages from an specific subdirectory of a Git repository. I have tried with the following baseline method, but it fails because does not understand repoPath:

baseline01: spec
<version: '0.1-baseline'>
spec
for: #common
do: [ 
spec blessing: #baseline.
spec repository: 'git@my-git-server:my-project'.
                        spec repoPath: 'my-pharo-subdirectory'.
spec
package: 'MyPackage'.
                        . . . ]

Thank you in advance.


Reply | Threaded
Open this post in threaded view
|

Re: Metacello configuration based on subdirectory of Git repo

Thierry Goubier
In reply to this post by Rafael Luque
Le 13/11/2014 18:21, Rafael Luque a écrit :

> Hi all,
>
> I'm starting with Pharo and playing with the ways to integrate it with Git.
>
> I've read the "Git and Pharo" chapter on "Enterprise Pharo" book by
> Thierry Goubier and loaded the GitFileTree package.
>
> I'm working on a project with several microservices, one of them will be
> based on Pharo and the other ones in other technologies. The project
> repository is based in our own Git server and each microservice maps
> with one subdirectory in the repo.
>
> My question is if it is possible to define a Metacello configuration to
> load my packages from an specific subdirectory of a Git repository. I
> have tried with the following baseline method, but it fails because does
> not understand repoPath:

Yes, it is possible to fix a specific subdirectory, with a gitfiletree:
url, via a dir=aRelativePath.

baseline01: spec
        <version: '0.1-baseline'>
        spec
  for: #common
  do: [
  spec blessing: #baseline.
  spec repository:
'gitfiletree://my-git-server/my-project&dir=my-pharo-subdirectory'.
  spec
    package: 'MyPackage'.
                           . . . ]

You can have a look at the ConfigurationOfAltBrowser in the
configuration browser to see how it triggers downloading the GitFileTree
support.

Thierry

> baseline01: spec
> <version: '0.1-baseline'>
> spec
> for: #common
> do: [
> spec blessing: #baseline.
> spec repository: 'git@my-git-server:my-project'.
>                          spec repoPath: 'my-pharo-subdirectory'.
> spec
> package: 'MyPackage'.
>                          . . . ]
>
> Thank you in advance.
>


Reply | Threaded
Open this post in threaded view
|

Re: Metacello configuration based on subdirectory of Git repo

Rafael Luque
Thank you for the responses.

I'll try both of them, but in the meantime I found another problem because of my lack of experience.

I'm trying to define in the baseline a dependency with another project, in particular the Stamp project by Sven Van Caekenberghe [1] in Smalltalkhub in the following way:

baseline01: spec
<version: '0.1-baseline'>
spec
for: #common
do: [ 
spec blessing: #baseline.
spec repository: 'filetree://full-filesystempath-to-your-pharo-subdirectory'.
spec
project: 'Stamp-Core'
with: [ 
spec
loads: 'Stamp';
version: #stable ].
spec
package: 'MyStompMessaging' with: [ spec requires: #('Stamp-Core') ] ]


When I evaluate the following in a Workspace:

(ConfigurationOfMyPackage project version: '0.1') load.

I get the followin error:

MessageNotUnderstood: receiver of "ensureLoadUsing:" is nil

In the debugger I see that MetacelloMCProjectSpec>>projectPackage is nil.

In an old thread I found that Dale Henrichs suggests to try this:

  MetacelloProjectRegistration
    resetRegistry;
    primeRegistryFromImage 

But in my case It does not solve the problem.


Thank you in advance.



2014-11-13 19:07 GMT+01:00 Thierry Goubier <[hidden email]>:
Le 13/11/2014 18:21, Rafael Luque a écrit :
Hi all,

I'm starting with Pharo and playing with the ways to integrate it with Git.

I've read the "Git and Pharo" chapter on "Enterprise Pharo" book by
Thierry Goubier and loaded the GitFileTree package.

I'm working on a project with several microservices, one of them will be
based on Pharo and the other ones in other technologies. The project
repository is based in our own Git server and each microservice maps
with one subdirectory in the repo.

My question is if it is possible to define a Metacello configuration to
load my packages from an specific subdirectory of a Git repository. I
have tried with the following baseline method, but it fails because does
not understand repoPath:

Yes, it is possible to fix a specific subdirectory, with a gitfiletree: url, via a dir=aRelativePath.

baseline01: spec
        <version: '0.1-baseline'>
        spec
                for: #common
                do: [
 spec blessing: #baseline.
 spec repository: 'gitfiletree://my-git-server/my-project&dir=my-pharo-subdirectory'.
 spec
   package: 'MyPackage'.
                          . . . ]

You can have a look at the ConfigurationOfAltBrowser in the configuration browser to see how it triggers downloading the GitFileTree support.

Thierry


baseline01: spec
<version: '0.1-baseline'>
spec
for: #common
do: [
spec blessing: #baseline.
spec repository: 'git@my-git-server:my-project'.
                         spec repoPath: 'my-pharo-subdirectory'.
spec
package: 'MyPackage'.
                         . . . ]

Thank you in advance.




Reply | Threaded
Open this post in threaded view
|

Re: Metacello configuration based on subdirectory of Git repo

Dale Henrichs-3
Rafael,

It looks like in your case that you've got a configuration problem ... and here's the proper fix (but depending upon which vesion of Metacello you're using may or may not work):

baseline01: spec
<version: '0.1-baseline'>
spec
for: #common
do: [ 
spec blessing: #baseline.
spec repository: 'filetree://full-filesystempath-to-your-pharo-subdirectory'.
spec
configuration: 'Stamp'
with: [ 
spec
loads: 'Stamp';
version: #stable ].
spec
package: 'MyStompMessaging' with: [ spec requires: #('Stamp') ] ]

if you get an error then the following should work:

baseline01: spec
<version: '0.1-baseline'>
spec
for: #common
do: [ 
spec blessing: #baseline.
spec repository: 'filetree://full-filesystempath-to-your-pharo-subdirectory'.
spec
project: 'Stamp-Core'
with: [ 
spec
                                                className: 'ConfigurationOfStamp';
loads: 'Stamp';
version: #stable ].
spec
package: 'MyStompMessaging' with: [ spec requires: #('Stamp-Core') ] ]

I've also submitted a metacello bug[1] to cover this issue, although I may have already fixed the bug in a later version of Metacello, I'm going to double check wihen I get a chance...

Finally, I would be interested to know what errors or warnings you might get from validating your configuration (inspect the result of MetacelloToolBox class>>validateConfiguration: with your configuration class as an argument).

HTH,



On Thu, Nov 13, 2014 at 12:28 PM, Rafael Luque <[hidden email]> wrote:
Thank you for the responses.

I'll try both of them, but in the meantime I found another problem because of my lack of experience.

I'm trying to define in the baseline a dependency with another project, in particular the Stamp project by Sven Van Caekenberghe [1] in Smalltalkhub in the following way:

baseline01: spec
<version: '0.1-baseline'>
spec
for: #common
do: [ 
spec blessing: #baseline.
spec repository: 'filetree://full-filesystempath-to-your-pharo-subdirectory'.
spec
project: 'Stamp-Core'
with: [ 
spec
loads: 'Stamp';
version: #stable ].
spec
package: 'MyStompMessaging' with: [ spec requires: #('Stamp-Core') ] ]


When I evaluate the following in a Workspace:

(ConfigurationOfMyPackage project version: '0.1') load.

I get the followin error:

MessageNotUnderstood: receiver of "ensureLoadUsing:" is nil

In the debugger I see that MetacelloMCProjectSpec>>projectPackage is nil.

In an old thread I found that Dale Henrichs suggests to try this:

  MetacelloProjectRegistration
    resetRegistry;
    primeRegistryFromImage 

But in my case It does not solve the problem.


Thank you in advance.



2014-11-13 19:07 GMT+01:00 Thierry Goubier <[hidden email]>:
Le 13/11/2014 18:21, Rafael Luque a écrit :
Hi all,

I'm starting with Pharo and playing with the ways to integrate it with Git.

I've read the "Git and Pharo" chapter on "Enterprise Pharo" book by
Thierry Goubier and loaded the GitFileTree package.

I'm working on a project with several microservices, one of them will be
based on Pharo and the other ones in other technologies. The project
repository is based in our own Git server and each microservice maps
with one subdirectory in the repo.

My question is if it is possible to define a Metacello configuration to
load my packages from an specific subdirectory of a Git repository. I
have tried with the following baseline method, but it fails because does
not understand repoPath:

Yes, it is possible to fix a specific subdirectory, with a gitfiletree: url, via a dir=aRelativePath.

baseline01: spec
        <version: '0.1-baseline'>
        spec
                for: #common
                do: [
 spec blessing: #baseline.
 spec repository: 'gitfiletree://my-git-server/my-project&dir=my-pharo-subdirectory'.
 spec
   package: 'MyPackage'.
                          . . . ]

You can have a look at the ConfigurationOfAltBrowser in the configuration browser to see how it triggers downloading the GitFileTree support.

Thierry


baseline01: spec
<version: '0.1-baseline'>
spec
for: #common
do: [
spec blessing: #baseline.
spec repository: 'git@my-git-server:my-project'.
                         spec repoPath: 'my-pharo-subdirectory'.
spec
package: 'MyPackage'.
                         . . . ]

Thank you in advance.





Reply | Threaded
Open this post in threaded view
|

Re: Metacello configuration based on subdirectory of Git repo

Rafael Luque
Hi Dale,

Your second option worked for me.

This is the validation error I got for my previous configuration using the MetacelloToolBox:

"Error: Missing required field (className:) for project reference 'Stamp' in version '0.1-baseline' { incompleteProjectSpec } [ #validateBaselineVersionSpec: ]"

By the other hand, using a filetree URL to my local working copy algo resolved the Stamp project dependency.

Thank you very much!

Rafa

2014-11-13 21:57 GMT+01:00 Dale Henrichs <[hidden email]>:
Rafael,

It looks like in your case that you've got a configuration problem ... and here's the proper fix (but depending upon which vesion of Metacello you're using may or may not work):

baseline01: spec
<version: '0.1-baseline'>
spec
for: #common
do: [ 
spec blessing: #baseline.
spec repository: 'filetree://full-filesystempath-to-your-pharo-subdirectory'.
spec
configuration: 'Stamp'
with: [ 
spec
loads: 'Stamp';
version: #stable ].
spec
package: 'MyStompMessaging' with: [ spec requires: #('Stamp') ] ]

if you get an error then the following should work:

baseline01: spec
<version: '0.1-baseline'>
spec
for: #common
do: [ 
spec blessing: #baseline.
spec repository: 'filetree://full-filesystempath-to-your-pharo-subdirectory'.
spec
project: 'Stamp-Core'
with: [ 
spec
                                                className: 'ConfigurationOfStamp';
loads: 'Stamp';
version: #stable ].
spec
package: 'MyStompMessaging' with: [ spec requires: #('Stamp-Core') ] ]

I've also submitted a metacello bug[1] to cover this issue, although I may have already fixed the bug in a later version of Metacello, I'm going to double check wihen I get a chance...

Finally, I would be interested to know what errors or warnings you might get from validating your configuration (inspect the result of MetacelloToolBox class>>validateConfiguration: with your configuration class as an argument).

HTH,



On Thu, Nov 13, 2014 at 12:28 PM, Rafael Luque <[hidden email]> wrote:
Thank you for the responses.

I'll try both of them, but in the meantime I found another problem because of my lack of experience.

I'm trying to define in the baseline a dependency with another project, in particular the Stamp project by Sven Van Caekenberghe [1] in Smalltalkhub in the following way:

baseline01: spec
<version: '0.1-baseline'>
spec
for: #common
do: [ 
spec blessing: #baseline.
spec repository: 'filetree://full-filesystempath-to-your-pharo-subdirectory'.
spec
project: 'Stamp-Core'
with: [ 
spec
loads: 'Stamp';
version: #stable ].
spec
package: 'MyStompMessaging' with: [ spec requires: #('Stamp-Core') ] ]


When I evaluate the following in a Workspace:

(ConfigurationOfMyPackage project version: '0.1') load.

I get the followin error:

MessageNotUnderstood: receiver of "ensureLoadUsing:" is nil

In the debugger I see that MetacelloMCProjectSpec>>projectPackage is nil.

In an old thread I found that Dale Henrichs suggests to try this:

  MetacelloProjectRegistration
    resetRegistry;
    primeRegistryFromImage 

But in my case It does not solve the problem.


Thank you in advance.



2014-11-13 19:07 GMT+01:00 Thierry Goubier <[hidden email]>:
Le 13/11/2014 18:21, Rafael Luque a écrit :
Hi all,

I'm starting with Pharo and playing with the ways to integrate it with Git.

I've read the "Git and Pharo" chapter on "Enterprise Pharo" book by
Thierry Goubier and loaded the GitFileTree package.

I'm working on a project with several microservices, one of them will be
based on Pharo and the other ones in other technologies. The project
repository is based in our own Git server and each microservice maps
with one subdirectory in the repo.

My question is if it is possible to define a Metacello configuration to
load my packages from an specific subdirectory of a Git repository. I
have tried with the following baseline method, but it fails because does
not understand repoPath:

Yes, it is possible to fix a specific subdirectory, with a gitfiletree: url, via a dir=aRelativePath.

baseline01: spec
        <version: '0.1-baseline'>
        spec
                for: #common
                do: [
 spec blessing: #baseline.
 spec repository: 'gitfiletree://my-git-server/my-project&dir=my-pharo-subdirectory'.
 spec
   package: 'MyPackage'.
                          . . . ]

You can have a look at the ConfigurationOfAltBrowser in the configuration browser to see how it triggers downloading the GitFileTree support.

Thierry


baseline01: spec
<version: '0.1-baseline'>
spec
for: #common
do: [
spec blessing: #baseline.
spec repository: 'git@my-git-server:my-project'.
                         spec repoPath: 'my-pharo-subdirectory'.
spec
package: 'MyPackage'.
                         . . . ]

Thank you in advance.






Reply | Threaded
Open this post in threaded view
|

Re: Metacello configuration based on subdirectory of Git repo

Rafael Luque
In reply to this post by Dale Henrichs-3

Hi Dale,

Your second option worked for me.

This is the validation error I got for my previous configuration using the MetacelloToolBox:

"Error: Missing required field (className:) for project reference 'Stamp' in version '0.1-baseline' { incompleteProjectSpec } [ #validateBaselineVersionSpec: ]"

By the other hand, using a filetree url to my local working copy algo resolved the Stamp project dependency.

Thank you very much!

Rafa

Rafael,

It looks like in your case that you've got a configuration problem ... and here's the proper fix (but depending upon which vesion of Metacello you're using may or may not work):

baseline01: spec
<version: '0.1-baseline'>
spec
for: #common
do: [ 
spec blessing: #baseline.
spec repository: 'filetree://full-filesystempath-to-your-pharo-subdirectory'.
spec
configuration: 'Stamp'
with: [ 
spec
loads: 'Stamp';
version: #stable ].
spec
package: 'MyStompMessaging' with: [ spec requires: #('Stamp') ] ]

if you get an error then the following should work:

baseline01: spec
<version: '0.1-baseline'>
spec
for: #common
do: [ 
spec blessing: #baseline.
spec repository: 'filetree://full-filesystempath-to-your-pharo-subdirectory'.
spec
project: 'Stamp-Core'
with: [ 
spec
                                                className: 'ConfigurationOfStamp';
loads: 'Stamp';
version: #stable ].
spec
package: 'MyStompMessaging' with: [ spec requires: #('Stamp-Core') ] ]

I've also submitted a metacello bug[1] to cover this issue, although I may have already fixed the bug in a later version of Metacello, I'm going to double check wihen I get a chance...

Finally, I would be interested to know what errors or warnings you might get from validating your configuration (inspect the result of MetacelloToolBox class>>validateConfiguration: with your configuration class as an argument).

HTH,



On Thu, Nov 13, 2014 at 12:28 PM, Rafael Luque <[hidden email]> wrote:
Thank you for the responses.

I'll try both of them, but in the meantime I found another problem because of my lack of experience.

I'm trying to define in the baseline a dependency with another project, in particular the Stamp project by Sven Van Caekenberghe [1] in Smalltalkhub in the following way:

baseline01: spec
<version: '0.1-baseline'>
spec
for: #common
do: [ 
spec blessing: #baseline.
spec repository: 'filetree://full-filesystempath-to-your-pharo-subdirectory'.
spec
project: 'Stamp-Core'
with: [ 
spec
loads: 'Stamp';
version: #stable ].
spec
package: 'MyStompMessaging' with: [ spec requires: #('Stamp-Core') ] ]


When I evaluate the following in a Workspace:

(ConfigurationOfMyPackage project version: '0.1') load.

I get the followin error:

MessageNotUnderstood: receiver of "ensureLoadUsing:" is nil

In the debugger I see that MetacelloMCProjectSpec>>projectPackage is nil.

In an old thread I found that Dale Henrichs suggests to try this:

  MetacelloProjectRegistration
    resetRegistry;
    primeRegistryFromImage 

But in my case It does not solve the problem.


Thank you in advance.



2014-11-13 19:07 GMT+01:00 Thierry Goubier <[hidden email]>:
Le 13/11/2014 18:21, Rafael Luque a écrit :
Hi all,

I'm starting with Pharo and playing with the ways to integrate it with Git.

I've read the "Git and Pharo" chapter on "Enterprise Pharo" book by
Thierry Goubier and loaded the GitFileTree package.

I'm working on a project with several microservices, one of them will be
based on Pharo and the other ones in other technologies. The project
repository is based in our own Git server and each microservice maps
with one subdirectory in the repo.

My question is if it is possible to define a Metacello configuration to
load my packages from an specific subdirectory of a Git repository. I
have tried with the following baseline method, but it fails because does
not understand repoPath:

Yes, it is possible to fix a specific subdirectory, with a gitfiletree: url, via a dir=aRelativePath.

baseline01: spec
        <version: '0.1-baseline'>
        spec
                for: #common
                do: [
 spec blessing: #baseline.
 spec repository: 'gitfiletree://my-git-server/my-project&dir=my-pharo-subdirectory'.
 spec
   package: 'MyPackage'.
                          . . . ]

You can have a look at the ConfigurationOfAltBrowser in the configuration browser to see how it triggers downloading the GitFileTree support.

Thierry


baseline01: spec
<version: '0.1-baseline'>
spec
for: #common
do: [
spec blessing: #baseline.
spec repository: 'git@my-git-server:my-project'.
                         spec repoPath: 'my-pharo-subdirectory'.
spec
package: 'MyPackage'.
                         . . . ]

Thank you in advance.