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

Feature/issue 353 #382

Merged
merged 3 commits into from
Aug 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 19 additions & 1 deletion .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,27 @@ jobs:
uses: actions/checkout@v2
with:
java-version: 1.8
fetch-depth: 0
-
name: Setup GitVersion action
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you please tell how will be mention Major and Minor? So we need to mention in PR name?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i read your comment and it seems like we need to mention in commit message.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you please update the Readme with what we need to mention for major release and minor release? Also with example explain what is the impact of major release, minor release and Patch in the github tag and docker version ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok will get this done

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@merry-degaga I merged this PR and I see that it has done a github release for the project where as i was thinking that it will just update the github tag and we will do the release as per our will.
https://github.com/SasanLabs/VulnerableApp/releases

is there a way we can stop it to create a release? From release, I point it as a major change so we notify about it in multiple channels.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I deleted the release for now.

Copy link
Contributor Author

@merry-degaga merry-degaga Aug 14, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, I will take a look.

@merry-degaga please help with #382 (comment)

I will look into preventing auto-release creation.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was able to prevent auto-release creation.

uses: gittools/actions/gitversion/[email protected]
with:
versionSpec: '5.x'
-
name: Execute GitVersion action
id: gitversion
uses: gittools/actions/gitversion/[email protected]
-
name: Publish release on GitHub
uses: softprops/action-gh-release@v1
with:
name: 'VulnerableApp-${{ steps.gitversion.outputs.semver }}'
tag_name: '${{ steps.gitversion.outputs.semver }}'
-
name: Grant execute permission for gradlew
run: chmod +x gradlew
-
name: Build with Gradle and Push
run: ./gradlew jib
run: |
./gradlew jib \
-Djib.to.tags='latest',$GITVERSION_SEMVER
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what would be GITVERSION_SEMVER?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is an output from gitversion action. When gitverson is executed it provides a number of outputs (see here for full list) and semVer is one of them. It will contain the calculated version for a build (see here for example)

Copy link
Member

@preetkaran20 preetkaran20 Aug 12, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok got it. can you please add few sample outputs of GITVERSION_SEMVER?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup, and add the sample outputs to the README as the examples?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sample outputs of GITVERSION_SEMVER on DockerHub :
image
image
image

27 changes: 27 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,33 @@ There are multiple ways in which you can contribute to the project:
1. If you are a developer and trying to start on to the project, then the suggestion is to go through the list of [issues](https://github.com/SasanLabs/VulnerableApp/issues) which contains `good first issue` which can be a good starter.
2. If you are a developer or a security professional looking to add new Vulnerability type then you can Generate the Sample Vulnerability by running `./gradlew GenerateSampleVulnerability`. It will generate the Sample Vulnerability template which has placeholders and comments. Modified files can be seen in the logs of the command or in the github history. You can navigate to those files, fill in the placeholders and then build the project to see the effect of the changes.
3. In case you are looking to contribute to the project by publicising it or working on the growth of the project, please feel free to add your thoughts to discussions section or issues and we can discuss over them.
### Semantic Versioning ###
Leveraging GitHub workflow and actions, semantic versioning is automated.
When committing your feature, you have the option to increment the version's major, minor, or patch value
by including <code>+semver:[major|minor|patch]</code> in your commit message. Major, minor, patch values are the
strings 'major', 'minor', and 'patch'.

Examples:
```properties
git commit -m "some text +semver:major"
git commit -m "+semver:minor some text"
git commit -m "+semver:patch some text"
```
By default, if the version is not provided in the commit message, then patch is incremented.

The updated version is used to create a tag for the latest published release on GitHub and DockerHub.

<em>Which version should be incremented?</em>

<table>
<thead><td>Version</td><td>Description</td></thead>
<tr><td>Major</td><td>Changes that break backwards compatibility</td></tr>
<tr><td>Minor</td><td>New features that are backwards compatible</td></tr>
<tr><td>Patch</td><td>Bug fixes that are backwards compatible</td></tr>
</table>
More information can be found at <a href="https://semver.org/" alt="semantic versioning specification">Semantic
Versioning
Specifiction</a>.

## Building the project
There are 2 ways in which this project can be built and used:
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ jib {
image = 'openjdk:8-jre-alpine'
}
to {
image = 'sasanlabs/owasp-vulnerableapp:unreleased'
image = 'sasanlabs/owasp-vulnerableapp'
}
}

Expand Down