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

Implementation of Platform API verification #233

Merged
merged 4 commits into from
Jan 23, 2020

Conversation

jromero
Copy link
Member

@jromero jromero commented Jan 22, 2020

Implements verification according to buildpacks/spec#67.

Caveats:

  • I did not create a compatible test for every binary due to the level of scaffolding necessary.
  • There isn't any mention of rebaser in the RFC or spec so I left it out. Should it be included?

Notes:

Resolves #224

@jromero jromero marked this pull request as ready for review January 23, 2020 02:36
@jromero jromero requested a review from a team as a code owner January 23, 2020 02:36
@jromero jromero added this to the lifecycle-0.6.0 milestone Jan 23, 2020
Copy link
Member

@ekcasey ekcasey left a comment

Choose a reason for hiding this comment

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

I feel a little iffy about introducing happy path acceptance tests that don't actually do the full setup etc. I think between the unit tests of the compatibility verification and the unhappy path tests we should be covered.

If you feel strongly that we should have them, we need to do more to control the test inputs (images that will never exist, temp dirs or discard for all relevant directories).

@ekcasey
Copy link
Member

ekcasey commented Jan 23, 2020

@jromero I think rebaser should be included. It should be part of the platform API despite the fact that the platform API is incompletely specified.

- Clean up acceptance tests
- Make PLATFORM_API configurable
- Add verification to rebaser
- Consolidate API compatibility method

Signed-off-by: Javier Romero <[email protected]>
@jromero jromero force-pushed the feature/224-compat-verification branch from d18d059 to 2b15a56 Compare January 23, 2020 17:34
@jromero jromero requested a review from ekcasey January 23, 2020 17:34
@ekcasey ekcasey merged commit d9736bd into master Jan 23, 2020
@ekcasey ekcasey deleted the feature/224-compat-verification branch January 23, 2020 17:39
@zmackie
Copy link
Contributor

zmackie commented Jan 23, 2020

Accepted with:

± zm |master U:1 ✗| → docker run -it -e CNB_PLATFORM_API=0.1 cnb/sample:accept-lifecycle-0.0.6
cnb@7a46687c39a6:/layers$ /lifecycle/detector
ERROR: failed to : the Lifecycle's Platform API version is 0.2 which is incompatible with Platform API version 0.1
cnb@7a46687c39a6:/layers$ exit
  |2.6.3| NY-Floater-15565 in ~/workspace/samples
± zm |master U:1 ✗| → docker run -it -e CNB_PLATFORM_API=0.2 cnb/sample:accept-lifecycle-0.0.6
cnb@5d6c4e2002ea:/layers$ /lifecycle/detector
ERROR: No buildpack groups passed detection.
ERROR: Please check that you are running against the correct path.
ERROR: failed to detect: no buildpacks participating
cnb@5d6c4e2002ea:/layers$ exit
  |2.6.3| NY-Floater-15565 in ~/workspace/samples
± zm |master U:1 ✗| → docker run -it -e CNB_PLATFORM_API=0.3 cnb/sample:accept-lifecycle-0.0.6
cnb@e252b0b054a7:/layers$ /lifecycle/detector
ERROR: failed to : the Lifecycle's Platform API version is 0.2 which is incompatible with Platform API version 0.3
cnb@e252b0b054a7:/layers$ exit
  |2.6.3| NY-Floater-15565 in ~/workspace/samples
± zm |master U:1 ✗| → docker run -it -e CNB_PLATFORM_API= cnb/sample:accept-lifecycle-0.0.6
cnb@90d6bce17f99:/layers$ /lifecycle/detector
ERROR: No buildpack groups passed detection.
ERROR: Please check that you are running against the correct path.
ERROR: failed to detect: no buildpacks participating
cnb@90d6bce17f99:/layers$ exit
  |2.6.3| NY-Floater-15565 in ~/workspace/samples
± zm |master U:1 ✗| → docker run -it -e CNB_PLATFORM_API='' cnb/sample:accept-lifecycle-0.0.6
cnb@97c404171261:/layers$ /lifecycle/detector
ERROR: No buildpack groups passed detection.
ERROR: Please check that you are running against the correct path.
ERROR: failed to detect: no buildpacks participating
cnb@97c404171261:/layers$ exit

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

Successfully merging this pull request may close these issues.

Support platform API verification
3 participants