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

Tranformation and templating tool #8

Open
jscotka opened this issue Mar 27, 2018 · 7 comments
Open

Tranformation and templating tool #8

jscotka opened this issue Mar 27, 2018 · 7 comments
Labels
enhancement New feature or request

Comments

@jscotka
Copy link
Collaborator

jscotka commented Mar 27, 2018

please provide tool what will be able to transform various metadata format like.
if you have metadata in one single file, tranform them to files in directory structure, or vice versa, from separate simple files, generate one complex file.

it would also nice to have there some generator what for example generates basic metadata files recursively in directory structure,
could work like find . -name "runtest.sh" -print "some strucutre to this directiry."
it could create basic test metadata templates

@psss psss added the enhancement New feature or request label May 22, 2018
@psss
Copy link
Collaborator

psss commented May 22, 2018

I can imagine we could provide a metadata write feature which could do one of the following three levels of the scatteredness (not sure about how we should handle overwriting existing files):

  1. One huge main.fmf file containing the whole metadata tree
  2. One main.fmf file plus additional object.fmf files in a single directory
  3. Separate main.fmf file for each metadata object, directories created as necessary

But what is the exact use case here? Do you expect some big batch changes in metadata? Would something like this be used often? Not sure it is worth to implement it.

@psss psss changed the title tranformation and templating tool Tranformation and templating tool May 22, 2018
@jscotka
Copy link
Collaborator Author

jscotka commented May 22, 2018

Yep, exactly that is also my idea to use these tree base formats.
Would works similar to similar tools like autopep8 what formats your code to better style or helps you for example to transform your mismatch code in one single place to separated files in case you would like to rewrite it to more complex scenarios.

If it is often scenario hard to say. Also some tool what helps you generate metadata from another format can use it. like beakerlib format.

@AloisMahdal
Copy link
Contributor

AloisMahdal commented May 22, 2018

I think that good rule of thumb is: if you can make use of a tool that generates the meta-data for you automatically, then, well, do you really need the data in the first place? I understand why there could be use case fo some basic templaing, like generating test dir, but what kind of structure to use should be project-specific and wokflow-specific decision.

Ie. it should not be job of fmf but job of some wizard tool that is developed for the given project.

(Just my 2 satoshis.)

@psss
Copy link
Collaborator

psss commented May 24, 2018

I think the fmf init use case mentioned in #26 makes a good sense. I can imagine we could even provide fmf init --examples which would populate the initialized metadata tree with a sample skeleton of metadata. Honza, would you be ok to, as the first step, limit scope of this issue for these two features?

@jscotka
Copy link
Collaborator Author

jscotka commented May 24, 2018

@psss yep, exacly. it is my idea and this transforming could be now forgotten, because noone is directly interested.

And we can use this issue for this init and template generator

Maybe it could be more clever and for example generate this tree structure based on directories and files inside, like I can imagine, that:

.
├── sanity1
│   └── runtest.sh
└── sanity2
    └── script.sh

and tooling like fmf init --element=test="glob.glob('*.sh')[0]" --element=tags="'[sanity]'" can produce main.fmf
with content like:

/sanity1
  test: runtest1.sh
  tags: [sanity]
/sanity2
  test: script1.sh
  tags: [sanity]

it is very pythonish and very powerful generator ;-)

@psss
Copy link
Collaborator

psss commented May 29, 2018

Interesting example with the glob matching. For the start I would suggest to only support some static skeleton, something similar you get when you call beaker-wizard -yf.

@jscotka
Copy link
Collaborator Author

jscotka commented Jul 12, 2018

I've implemented it via #46

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

No branches or pull requests

3 participants