Skip to content
This repository was archived by the owner on Nov 16, 2023. It is now read-only.

Adding Version Endpoints to all apis#217

Merged
BSamodien merged 5 commits intoAzure-Samples:openhack_refreshfrom
hattan:version_refactor
May 22, 2020
Merged

Adding Version Endpoints to all apis#217
BSamodien merged 5 commits intoAzure-Samples:openhack_refreshfrom
hattan:version_refactor

Conversation

@hattan
Copy link
Copy Markdown
Contributor

@hattan hattan commented May 21, 2020

Purpose

This PR introduces new endpoints for all apis. The endpoint is /api/version/

This is done via a docker environment variable that is assigned during the docker build phase. This can be set via the command line by adding --build-arg to docker build.

The purpose of this is to make it easy and provide a standard way for teams to see updates to their api. Rather than having to mess with the code for each api (and change healthchecks) , teams can easily add --build-arg to their pipeline.

For example:

docker build -t api-poi:$(Build.BuildId) --build-arg build_version=$(BuildBuildId)

By doing this during an automated build the deployed api will always show a unique version number in it's version endpoint. This makes it much easier for folks to see changes without needing to update the api code itself.

Does this introduce a breaking change?

[ ] Yes
[X] No

Pull Request Type

What kind of change does this Pull Request introduce?

[ ] Bugfix
[X] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Documentation content changes
[ ] Other... Please describe:

How to Test

  • Get the code
  • for each api:
    (poi example)
  cd apis/poi/web
  docker build -t api-poi:test123 --build-arg build_version=test123 .
  docker run -p 8080:8080 api-poi
  curl localhost:8080/api/version/poi

Comment thread apis/trips/tripsgo/versionService.go Outdated
Comment thread apis/user-java/src/main/java/io/swagger/api/VersionApi.java Outdated
Comment thread apis/user-java/src/main/java/io/swagger/api/VersionApiController.java Outdated
Comment thread apis/userprofile/Dockerfile Outdated
Comment thread apis/userprofile/handlers/version/user.js Outdated
Copy link
Copy Markdown
Contributor

@BSamodien BSamodien left a comment

Choose a reason for hiding this comment

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

Nit picky linter is complaining about lack of new line at the end of a few files

@hattan hattan requested a review from BSamodien May 21, 2020 20:08
Copy link
Copy Markdown
Contributor

@BSamodien BSamodien left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Copy Markdown
Contributor

@BSamodien BSamodien left a comment

Choose a reason for hiding this comment

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

LGTM

@BSamodien BSamodien merged commit c5b39ab into Azure-Samples:openhack_refresh May 22, 2020
DariuszPorowski added a commit that referenced this pull request Sep 17, 2021
* Migrated POI APIs to netcore 3.1 and implemented the native healthchecks (#194)

* Properly upgraded to netcore 2.2

* updated POI to netcore 3.0

* updated UnitTest to netcore 3.0

* updated IntegrationTest to netcore 3.0

* updated POI to netcore 3.1

* updated UnitTest to netcore 3.1

* updated IntegrationTest to netcore 3.1

* Cleanup

* Small refactoring

* Updated packages to latest version

* Migrate Health Checks to netcore 3.1 standard

* Migrate Health Checks to netcore 3.1 standard

* Migrate Health Checks to netcore 3.1 standard

* Ensure DB is created

* Added proper references to the README files

* Updated Dockerfile for netcore 3.1

* Fix

* Dmckinstry/v2 consolidated (#201)

* Dmckinstry/java updates (#196)

* Remove HELM Charts
Cleanup POM dependencies
Update to JRE8

* Cleanup imports / compiler warnings

* Bump acorn from 5.7.1 to 5.7.4 in /apis/userprofile (#197)

Bumps [acorn](https://github.com/acornjs/acorn) from 5.7.1 to 5.7.4.
- [Release notes](https://github.com/acornjs/acorn/releases)
- [Commits](acornjs/acorn@5.7.1...5.7.4)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump js-yaml from 3.12.0 to 3.13.1 in /apis/userprofile (#198)

Bumps [js-yaml](https://github.com/nodeca/js-yaml) from 3.12.0 to 3.13.1.
- [Release notes](https://github.com/nodeca/js-yaml/releases)
- [Changelog](https://github.com/nodeca/js-yaml/blob/master/CHANGELOG.md)
- [Commits](nodeca/js-yaml@3.12.0...3.13.1)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump lodash from 4.17.10 to 4.17.15 in /apis/userprofile (#199)

Bumps [lodash](https://github.com/lodash/lodash) from 4.17.10 to 4.17.15.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](lodash/lodash@4.17.10...4.17.15)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump morgan from 1.9.0 to 1.9.1 in /apis/userprofile (#200)

Bumps [morgan](https://github.com/expressjs/morgan) from 1.9.0 to 1.9.1.
- [Release notes](https://github.com/expressjs/morgan/releases)
- [Changelog](https://github.com/expressjs/morgan/blob/master/HISTORY.md)
- [Commits](expressjs/morgan@1.9.0...1.9.1)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Delete all HELM charts

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Removed AKS references fom Readme (#207)

* Enpolat/204 update swagger versions (#205)

* swagger aspnetcore version bumped

* swagger version bumped

* unneccessary sections removed

* main method is a one-liner

* commented code piece removed

* swagger generator middleware re-styled and description added

* redundant yaml file removed

* description field added

* schemas list removed in order to make it look-a-like with the other apis swagger uis

* http method names uppercased, no need to do it during runtime

* latest go version added to module

* go dependency bumped

* swagger ui dependency bumped

* testify version bumped

* swagger dependency version bumped to latest version

* mssql dependency added, in case machine does not have it

* api name modified, description added

* url paths changed to make it look like similar to other apis swagger uis

* name of the api modified and description field added

* schemas removed

* tags field added, so all the operations will be presented under the same section

* unneccessary field removed

* default response model renamed

* lock file updated with the latest versions of the dependencies

* all dependency versions bumped

* latest version of swaggerui dependency added

* unneccessary dependency removed

* code modified, according to the changes of the latest version of swagger ui dependency

* no need to set go version 1.11

* golang version bumped to latest in the build stage

* dropped buster from the golang tag

* dependency versions bumped

* localhost part removed from swagger json url

* updating user java pom.xml to add in missing sql server dependency (#216)

* updating user java pom.xml to add in missing sql server dependency

* removing extra mockito-core dependency

* Adding Version Endpoints to all apis (#217)

* poi version

* adding version to trips

* initial java version

* adding version for userprofile

* adding newlines to certain files to satisfy linter

* fixed runtime dependencies of user profile (#218)

* POI - Increased Code Coverage (#219)

* added more poi unit tests

* added healthcheck and POIConfig tests

* Trips  Increased Code Coverage (#220)

* moved golang tests to support coverage

* added more queries unit tests

* refactored queries test to use assert

* added version tests

* renamed healthcheck test file and added swagger service tests

* Added swagger service missing file test

* added logger tests

* added more query tests

* fixed integration tests and bug in gettripsforuser query

* Added dataaccess integration tests

* added failure tests for tripsservice

* Added cleanup to data access test

* updated readme for trips to include unit and integratino test instructions

* fixes userprofile unit tests (#227)

* Bump path-parse from 1.0.5 to 1.0.7 in /apis/userprofile (#286)

Bumps [path-parse](https://github.com/jbgutierrez/path-parse) from 1.0.5 to 1.0.7.
- [Release notes](https://github.com/jbgutierrez/path-parse/releases)
- [Commits](https://github.com/jbgutierrez/path-parse/commits/v1.0.7)

---
updated-dependencies:
- dependency-name: path-parse
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Dariusz Porowski <3431813+DariuszPorowski@users.noreply.github.com>

* Bump lodash from 4.17.10 to 4.17.21 in /apis/userprofile (#277)

Bumps [lodash](https://github.com/lodash/lodash) from 4.17.10 to 4.17.21.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](lodash/lodash@4.17.10...4.17.21)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Dariusz Porowski <3431813+DariuszPorowski@users.noreply.github.com>

* Bump extend from 3.0.0 to 3.0.2 in /apis/userprofile (#177)

Bumps [extend](https://github.com/justmoon/node-extend) from 3.0.0 to 3.0.2.
- [Release notes](https://github.com/justmoon/node-extend/releases)
- [Changelog](https://github.com/justmoon/node-extend/blob/master/CHANGELOG.md)
- [Commits](justmoon/node-extend@v3.0.0...v3.0.2)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Update README.md (#299)

Co-authored-by: v-rajagt <31903563+v-rajagt@users.noreply.github.com>

* Ohfix master (#300)

* 3.1 mcr

* HealthCheckResponse (#302)

Co-authored-by: Dariusz Porowski <Dariusz.Porowski@microsoft.com>

* Devcontainer (#303)

* added devcontainer (#226)

Co-authored-by: Ben Coleman <benc.uk@gmail.com>
Co-authored-by: Dariusz Porowski <Dariusz.Porowski@microsoft.com>

Co-authored-by: Davide Benvegnù <davide.benvegnu@outlook.com>
Co-authored-by: Dave McKinstry <dmckinstry@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Brent <BSamodien@users.noreply.github.com>
Co-authored-by: Engin Polat <polatengin@hotmail.com>
Co-authored-by: Hattan Shobokshi <hattan@gmail.com>
Co-authored-by: Ben Coleman <benc.uk@gmail.com>
Co-authored-by: v-rajagt <31903563+v-rajagt@users.noreply.github.com>
Co-authored-by: Dariusz Porowski <Dariusz.Porowski@microsoft.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants