Skip to content

Add a check enforce "samples/" folder to be up-to-date #80

@jmini

Description

@jmini

I think that with each PR, the samples/ needs to be completely updated. For the moment people focus only on their generators (which is fine), but this is wrong.

First reason: some CI Jobs are updating /samples with /bin/run-all-petstore and then run each generated project. So they are not executed against code that is checked in, but against code that is generated.

Second reason: for later analysis (understand what was broken when) it is good to have the changes in the same PR.

Third reason: even if you think that you have only updated one generator (say java) your change might have an undesired impact in a other generator. Having it explicitly is good. This is even worth when you change something in DefaultGenerator (see my mistake in #79)


Pre-requisit:

  • All generators needs to support the hide generation timestamp feature.
  • All examples in the samples/ project needs to have been generated once

The check should looks like this and could be added at the end of bin/run-all-petstore:

if ! `git diff-index --quiet HEAD -- `; then
    echo "There are uncommitted changes in working tree after execution of 'bin/run-all-petstore'"
    git status
    echo "Please commit changes"
    exit 1
else
    echo "Git working tree is clean"
fi

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions