Skip to content
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

Conscript should be more flexible about launchconfig locations #63

Open
clhodapp opened this issue Jun 1, 2014 · 2 comments
Open

Conscript should be more flexible about launchconfig locations #63

clhodapp opened this issue Jun 1, 2014 · 2 comments

Comments

@clhodapp
Copy link

clhodapp commented Jun 1, 2014

Right now, conscript searches for launchconfig files using the pattern "^src/main/conscript/([^/]+)/launchconfig$". The problem with this is that it's too inflexible. I personally think that launchconfig files are not part of the source of my application and don't want them in src/main (or even in src). I expect that a lot of people do think of their launchconfigs as part of their sources, but maybe they don't keep the source files for their application at the top of their repository in a directory called "src". For this reason, I'd advocate changing the pattern to something more like "(?:^|.+/)conscript/([^/]+)/launchconfig$". This pattern should match any files that are matched now (I think), but also allow e.g. a "conscript" directory at the top of the repository or one inside of a project that isn't at the top. Thoughts?

@eed3si9n
Copy link
Member

I think this is a good idea. Does Github have an API that can query for this pattern?
If someone wants to implement this, I'd be happy to review a pull request.

@michalmela
Copy link

michalmela commented Jun 26, 2016

Indeed, it seems that Github provides an API for recursively listing all the objects (blobs or trees) in a particular tree. One of the HTTP requests that Conscript makes (for, e.g., giter8) is for this URL:

https://api.github.com/repos/foundweekends/giter8/git/trees/9bfc23a17fe35f52e8b5f5ec348f0fd6a396d975?recursive=1

Of particular interest under the URL above is this object:

{
  "path": "src/main/conscript/g8/launchconfig",
  "mode": "100644",
  "type": "blob",
  "sha": "58800cd1cf1f81e53600b5381acfec71039a9d45",
  "size": 231,
  "url": "https://api.github.com/repos/foundweekends/giter8/git/blobs/58800cd1cf1f81e53600b5381acfec71039a9d45"
}

So one can see that the full path can be retrieved easily Therefore, simply replacing the Regex used for finding the launchconfig file should do the job. I can prepare the pull request.

On the other hand, maybe it would make more sense to provide an alternative file-naming scheme altogether? There is a really nice pattern going lately with similar file descriptors: Dockerfile, Makefile, Rakefile, Vagrantfile... So how about letting the repo owners place a Conscriptfile anywhere in the repo? This would, of course, be just as an alternative as I guess it's not worth breaking backwards compatibility.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

3 participants