Skip to content
This repository has been archived by the owner on Jul 28, 2023. It is now read-only.

Allow The regex matching on fullpath or the on only the filename/ (leaf directory) #38

Open
kewegner opened this issue Sep 20, 2019 · 3 comments
Labels
enhancement New feature or request

Comments

@kewegner
Copy link
Collaborator

Currently the APPSODY_REGEX only is used against the file name or leaf directory rather than the full path.

It would be desirable to give users a choice.

Other Options:

It is also possible that we could default to the full path. But we would want to make sure we don't break existing stacks.

@kewegner
Copy link
Collaborator Author

@neeraj-laad do you have an opinion? In looking at the current stacks REGEX settings, I think java-spring-boot2 might have an issue with changing it universally.

Given no one is currently broken, we can take our time in making a decision on this.

@kewegner
Copy link
Collaborator Author

kewegner commented Dec 3, 2019

If we do this, we'd need to do the following:

  1. Declare and Document a new variable for stacks to use

APPSODY_REGEX_FULL_PATH (true/false) default is false

  1. Then in the code for setting up the environment variables in main.go:
    appsodyRegexFullPathFlag:=false

appsodyRegexFullPath:= os.Getenv("APPSODY_REGEX_FULL_PATH")
if appsodyRegexFullPath !="" {
appsodyRegexFullPathFlag=strconv.ParseBool(appsodyRegexFullPath)
}

  1. Then modify this line:
    w.AddFilterHook(watcher.RegexFilterHook(r, appsodyRegexFullPathFlag))

Note that the real work here would be testing it on the stacks. For now we stick to the default of false, but if it were decided to make the default true, it would be a lot of work to go through the 15+ stacks and test if making it full path broke anything re: the regex.

@kewegner kewegner added the enhancement New feature or request label Dec 3, 2019
@kewegner
Copy link
Collaborator Author

kewegner commented Dec 3, 2019

If you want to have both full path and file only, you'd need two filter hooks, and you'd need probably multiple watchdir/regex pairs, and they would need to be ordered. So that feature would be more work.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant