-
-
Notifications
You must be signed in to change notification settings - Fork 27
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
Git resolver #99
Git resolver #99
Conversation
Resolve vcl includes based on a set of versioned directories. Signed-off-by: Sotiris Nanopoulos <[email protected]>
Signed-off-by: Sotiris Nanopoulos <[email protected]>
// if (req.http.Host) { | ||
// set req.http.Fourth = re.group.3; // difficult to know which (1) or (2) matched result is used or empty | ||
// } | ||
// if (req.http.Host) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
linter is not happy without this change 🤷
I have a couple of opinions.
Example: falco -v git://github.com/org/repo # use GIt resolver
falco -v ./main.vcl # use File resolver
I understand that the |
I started implementing this with https://github.com/go-git/go-git but I thought in the end that it wasnt worth it. Mainly for two reasons:
Basically at this point given that we do only one git call it seems like a decent tradeoff not to pull an entire git implementation and rely on a subprocess call. Especially because I didnt have to handle the output and I just take the whole stdout of the process.
Does this mean adding the prefix |
Yes, for example, if And from another perspective, I think the following commands are the same behavior for managing VCLs on another repository: git clone [email protected]:org/repo # ssh or https
falco -I ./repo path/to/main.vcl The above syntax is the common use case and clearly divides the matter of concern git authentication I think, so I'm not sure that the worth of supporting git communication (of course git submodule is not a good way, but...) It is useful for the continuous integration of local development, Or if there are more benefits, please let me know. |
Sadly this is not exactly the same and this is the problem I run into: Imagine that you have repo 1 that contains:
Then main_1.vcl could depend on version 1 of a dependency and main_2.vcl on version 2. And even within just |
@davinci26 Hmm, could you show me in detail of use case using github repo?
I could not imagine that some VCL file depends on other versions. In my use case, all VCL files indicate one version and it's the standard way of managing VCL. @shadialtarsha @ivomurrell could you hear me your opinition on this case? |
If I understand correctly than some special tooling is required when deploying VCL that specifies Git versions for dependencies, as Fastly's |
@ivomurrell I think that it is a good idea to use standard git uri for include paths which make it more upstream friendly and also I think versioned VCL files is a natural progression if you manage a big VCL corpus so this is why I wanted to push it. Imagine that you have the following scenario:
Then you want to rollout the
|
@davinci26 I can definitely see the utility of the approach you're describing, but the problem still seems to be that the rollout facility depends on custom deployment tooling to parse and resolve the special |
Realized that the TF mode is solving all my problem and I can TF plan to do this for me. I think this is a win-win overall :) This is no longer needed, thanks a lot for the feedback tho! |
See #102 |
Fixes #98
This adds two new command line flags:
-git
: Which controls if paths are treated as versioned paths-repo
: Which set the path to the git repositoryNow all include paths are parsed to extract the version (git version) if present. If present we resolve the file with
git show
rather than opening the file directlychose to use
git
cmd rather than an in memory git implementation because it is harder with authentication etc