From 4f867359f5789275e8dde75cc96bc39823b823bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20ceylan?= Date: Tue, 10 Aug 2021 15:53:27 +0300 Subject: [PATCH 01/21] draft --- text/0000-project-toml-converter.md | 75 +++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 text/0000-project-toml-converter.md diff --git a/text/0000-project-toml-converter.md b/text/0000-project-toml-converter.md new file mode 100644 index 000000000..9577914ec --- /dev/null +++ b/text/0000-project-toml-converter.md @@ -0,0 +1,75 @@ +# Meta +[meta]: #meta +- Name: Project TOML Converter +- Start Date: 10 Aug 2021 +- Author(s): haliliceylan +- RFC Pull Request: (leave blank) +- CNB Pull Request: (leave blank) +- CNB Issue: (leave blank) +- Supersedes: N/A + +# Summary +[summary]: #summary + +The idea is to ship a binary with the lifecycle that would be responsible for translating project.toml 0.2 into something that the lifecycle knows the platform can understand + +# Definitions +[definitions]: #definitions + +Make a list of the definitions that may be useful for those reviewing. Include phrases and words that buildpack authors or other interested parties may not be familiar with. + +# Motivation +[motivation]: #motivation + +- Actually this feature, sounds like part of prepare-phase. But this is so simple and we can build fast. +- Sometimes Operators has some issues with different project.toml files. As you know system operator can not easily upgrade their system packages, pack and buildpacks. So with this feature we are giving to developers able to use always latest version of project.toml. In same time we are giving to operators able to stable update scheduling. + +- What is the expected outcome? + +# What it is +[what-it-is]: #what-it-is + +This provides a high level overview of the feature. + +- Define any new terminology. +- Define the target persona: buildpack author, buildpack user, platform operator, platform implementor, and/or project contributor. +- Explaining the feature largely in terms of examples. +- If applicable, provide sample error messages, deprecation warnings, or migration guidance. +- If applicable, describe the differences between teaching this to existing users and new users. + +# How it Works +[how-it-works]: #how-it-works + +This is the technical portion of the RFC, where you explain the design in sufficient detail. + +The section should return to the examples given in the previous section, and explain more fully how the detailed proposal makes those examples work. + +# Drawbacks +[drawbacks]: #drawbacks + +Why should we *not* do this? + +# Alternatives +[alternatives]: #alternatives + +- What other designs have been considered? +- Why is this proposal the best? +- What is the impact of not doing this? + +# Prior Art +[prior-art]: #prior-art + +Discuss prior art, both the good and bad. + +# Unresolved Questions +[unresolved-questions]: #unresolved-questions + +- What parts of the design do you expect to be resolved before this gets merged? +- What parts of the design do you expect to be resolved through implementation of the feature? +- What related issues do you consider out of scope for this RFC that could be addressed in the future independently of the solution that comes out of this RFC? + +# Spec. Changes (OPTIONAL) +[spec-changes]: #spec-changes +Does this RFC entail any proposed changes to the core specifications or extensions? If so, please document changes here. +Examples of a spec. change might be new lifecycle flags, new `buildpack.toml` fields, new fields in the buildpackage label, etc. +This section is not intended to be binding, but as discussion of an RFC unfolds, if spec changes are necessary, they should be documented here. From 58430fc674494be375186d25bad74a56c35ea728 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20ceylan?= Date: Tue, 10 Aug 2021 16:18:43 +0300 Subject: [PATCH 02/21] last --- text/0000-project-toml-converter.md | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/text/0000-project-toml-converter.md b/text/0000-project-toml-converter.md index 9577914ec..680a07608 100644 --- a/text/0000-project-toml-converter.md +++ b/text/0000-project-toml-converter.md @@ -16,7 +16,7 @@ The idea is to ship a binary with the lifecycle that would be responsible for tr # Definitions [definitions]: #definitions -Make a list of the definitions that may be useful for those reviewing. Include phrases and words that buildpack authors or other interested parties may not be familiar with. +* __project descriptor__ - the [`project.toml`](https://github.com/buildpacks/spec/blob/main/extensions/project-descriptor.md) extension specification # Motivation [motivation]: #motivation @@ -29,13 +29,7 @@ Make a list of the definitions that may be useful for those reviewing. Include p # What it is [what-it-is]: #what-it-is -This provides a high level overview of the feature. - -- Define any new terminology. -- Define the target persona: buildpack author, buildpack user, platform operator, platform implementor, and/or project contributor. -- Explaining the feature largely in terms of examples. -- If applicable, provide sample error messages, deprecation warnings, or migration guidance. -- If applicable, describe the differences between teaching this to existing users and new users. +The Project TOML Converter is a CLI tool. seperated from pack and buildpack. It has only one responsibility, maintain project descriptor versions. support conversion between versions. # How it Works [how-it-works]: #how-it-works From c0bb4dd333eca35063934f0c5d01bda1b01933e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20ceylan?= Date: Thu, 12 Aug 2021 23:19:59 +0300 Subject: [PATCH 03/21] Update text/0000-project-toml-converter.md Co-authored-by: Natalie Arellano --- text/0000-project-toml-converter.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/text/0000-project-toml-converter.md b/text/0000-project-toml-converter.md index 680a07608..74c3e0b18 100644 --- a/text/0000-project-toml-converter.md +++ b/text/0000-project-toml-converter.md @@ -11,7 +11,7 @@ # Summary [summary]: #summary -The idea is to ship a binary with the lifecycle that would be responsible for translating project.toml 0.2 into something that the lifecycle knows the platform can understand +The idea is to ship a binary with the lifecycle that would be responsible for translating project.toml from the schema defined in the project descriptor extension spec into something that the lifecycle knows the platform can understand i.e., a schema defined in the platform spec. # Definitions [definitions]: #definitions From b2f1208793dff9d01f9ca382ef8dbf28c5313407 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20ceylan?= Date: Fri, 13 Aug 2021 10:46:03 +0300 Subject: [PATCH 04/21] CNB_PLATFORM_API --- text/0000-project-toml-converter.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/text/0000-project-toml-converter.md b/text/0000-project-toml-converter.md index 680a07608..90985d6cd 100644 --- a/text/0000-project-toml-converter.md +++ b/text/0000-project-toml-converter.md @@ -16,7 +16,9 @@ The idea is to ship a binary with the lifecycle that would be responsible for tr # Definitions [definitions]: #definitions -* __project descriptor__ - the [`project.toml`](https://github.com/buildpacks/spec/blob/main/extensions/project-descriptor.md) extension specification +* __project descriptor__ - a file that is included in the application directory to configure various behavior related to buildpacks; for more information, see the [`project.toml`](https://github.com/buildpacks/spec/blob/main/extensions/project-descriptor.md) extension specification + +* __CNB_PLATFORM_API__ The Project TOML Converter will use the `CNB_PLATFORM_API` environment variable to decide which API to implement. For now, if `CNB_PLATFORM_API` is not supplied, platform API 0.3 (the currently implemented API) will be assumed, to avoid breaking existing platforms that do not currently set this environment variable. # Motivation [motivation]: #motivation From e9ca776bd59e4c6f3bd07ccadcb58ee0f639b8d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20ceylan?= Date: Fri, 13 Aug 2021 10:47:10 +0300 Subject: [PATCH 05/21] motivation prepare phase --- text/0000-project-toml-converter.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/text/0000-project-toml-converter.md b/text/0000-project-toml-converter.md index 90985d6cd..698f7a410 100644 --- a/text/0000-project-toml-converter.md +++ b/text/0000-project-toml-converter.md @@ -23,7 +23,8 @@ The idea is to ship a binary with the lifecycle that would be responsible for tr # Motivation [motivation]: #motivation -- Actually this feature, sounds like part of prepare-phase. But this is so simple and we can build fast. +- This feature has similarities with the "prepare" phase that has been discussed previously (see #555). But it is much smaller in scope. Potentially, the binary described in this RFC could eventually take on more responsibilities and look more like "prepare". But that is out of scope for this RFC. + - Sometimes Operators has some issues with different project.toml files. As you know system operator can not easily upgrade their system packages, pack and buildpacks. So with this feature we are giving to developers able to use always latest version of project.toml. In same time we are giving to operators able to stable update scheduling. - What is the expected outcome? From a1b999f52346faedf6d6fa30f2190c3120d7c3a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20ceylan?= Date: Fri, 13 Aug 2021 10:53:08 +0300 Subject: [PATCH 06/21] motivation paraphraph 2 --- text/0000-project-toml-converter.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/text/0000-project-toml-converter.md b/text/0000-project-toml-converter.md index 698f7a410..f80c677d9 100644 --- a/text/0000-project-toml-converter.md +++ b/text/0000-project-toml-converter.md @@ -25,7 +25,7 @@ The idea is to ship a binary with the lifecycle that would be responsible for tr - This feature has similarities with the "prepare" phase that has been discussed previously (see #555). But it is much smaller in scope. Potentially, the binary described in this RFC could eventually take on more responsibilities and look more like "prepare". But that is out of scope for this RFC. -- Sometimes Operators has some issues with different project.toml files. As you know system operator can not easily upgrade their system packages, pack and buildpacks. So with this feature we are giving to developers able to use always latest version of project.toml. In same time we are giving to operators able to stable update scheduling. +- It is non-trivial for platform operators to upgrade support for different versions of project.toml. Project Descriptor is a file which describe behavior related to buildpacks. Platform operators need to give these behaviors according to developer app requests. So with this feature we are giving to developers the ability to use any version of project.toml knowing that the platform can always support it. At the same time we are giving to operators the convenience of only having to know about one schema at a time for project.toml. - What is the expected outcome? @@ -66,7 +66,7 @@ Discuss prior art, both the good and bad. - What related issues do you consider out of scope for this RFC that could be addressed in the future independently of the solution that comes out of this RFC? # Spec. Changes (OPTIONAL) -[spec-changes]: #spec-changes +[spec-changes]: #spec-changesf Does this RFC entail any proposed changes to the core specifications or extensions? If so, please document changes here. Examples of a spec. change might be new lifecycle flags, new `buildpack.toml` fields, new fields in the buildpackage label, etc. This section is not intended to be binding, but as discussion of an RFC unfolds, if spec changes are necessary, they should be documented here. From b62b4891637263747c9c939e39050b5563caf33b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20ceylan?= Date: Fri, 13 Aug 2021 10:53:54 +0300 Subject: [PATCH 07/21] What it is --- text/0000-project-toml-converter.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/text/0000-project-toml-converter.md b/text/0000-project-toml-converter.md index f80c677d9..bbb94edef 100644 --- a/text/0000-project-toml-converter.md +++ b/text/0000-project-toml-converter.md @@ -32,7 +32,7 @@ The idea is to ship a binary with the lifecycle that would be responsible for tr # What it is [what-it-is]: #what-it-is -The Project TOML Converter is a CLI tool. seperated from pack and buildpack. It has only one responsibility, maintain project descriptor versions. support conversion between versions. +The Project TOML Converter is a CLI tool that will ship alongside the lifecycle. It has only one responsibility at this time, to support conversion between schemas. # How it Works [how-it-works]: #how-it-works From ac955aba7c079b10757d10ff38cffef56c4f45aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20ceylan?= Date: Fri, 13 Aug 2021 10:54:10 +0300 Subject: [PATCH 08/21] natalie author --- text/0000-project-toml-converter.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/text/0000-project-toml-converter.md b/text/0000-project-toml-converter.md index bbb94edef..c111a88c9 100644 --- a/text/0000-project-toml-converter.md +++ b/text/0000-project-toml-converter.md @@ -2,7 +2,7 @@ [meta]: #meta - Name: Project TOML Converter - Start Date: 10 Aug 2021 -- Author(s): haliliceylan +- Author(s): haliliceylan, natalieparellano - RFC Pull Request: (leave blank) - CNB Pull Request: (leave blank) - CNB Issue: (leave blank) From 3e932628759e0f2c8b3aaf8e170024d45c3495f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20ceylan?= Date: Sun, 15 Aug 2021 17:51:55 +0300 Subject: [PATCH 09/21] project toml example --- text/0000-project-toml-converter.md | 32 ++++++++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-) diff --git a/text/0000-project-toml-converter.md b/text/0000-project-toml-converter.md index c111a88c9..e41cba513 100644 --- a/text/0000-project-toml-converter.md +++ b/text/0000-project-toml-converter.md @@ -37,9 +37,35 @@ The Project TOML Converter is a CLI tool that will ship alongside the lifecycle. # How it Works [how-it-works]: #how-it-works -This is the technical portion of the RFC, where you explain the design in sufficient detail. - -The section should return to the examples given in the previous section, and explain more fully how the detailed proposal makes those examples work. +Example Project.TOML +``` +[project] +id = "io.buildpacks.my-app" +version = "0.1" + +[build] +include = [ + "cmd/", + "go.mod", + "go.sum", + "*.go" +] + +[[build.buildpacks]] +id = "io.buildpacks/java" +version = "1.0" + +[[build.buildpacks]] +id = "io.buildpacks/nodejs" +version = "1.0" + +[metadata] +foo = "bar" + +[metadata.fizz] +buzz = ["a", "b", "c"] +``` +TODO: Which keys are platform specific ? idk maybe metadata or buildpacks order. # Drawbacks [drawbacks]: #drawbacks From 5c219d97aaada247d087ef4467ac0e5adf269d5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20ceylan?= Date: Sun, 15 Aug 2021 17:58:50 +0300 Subject: [PATCH 10/21] some changes --- text/0000-project-toml-converter.md | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/text/0000-project-toml-converter.md b/text/0000-project-toml-converter.md index 563f1b0ed..a833c08f1 100644 --- a/text/0000-project-toml-converter.md +++ b/text/0000-project-toml-converter.md @@ -75,24 +75,20 @@ Why should we *not* do this? # Alternatives [alternatives]: #alternatives -- What other designs have been considered? -- Why is this proposal the best? -- What is the impact of not doing this? +- having the lifecycle process project.toml directly (like prepare phase see: #555). Prepare is not only for this problem, is kinda big and have a lot of responsibility. This RFC Topic is only focusing this problem so can be done quick and well tested. +- do nothing, hope everything will be fine (We can leave as it is). We think it's too hard for platform operators to support multiple versions of project.toml. The platform API already represents the contract between the lifecycle and the platform, so it makes more sense than "project descriptor schema -> project descriptor schema" translation. +- having the translator binary translate from e.g., project.toml schema 0.1 -> project.toml schema 0.2 (actually this RFC). # Prior Art -[prior-art]: #prior-art +[prior-art]: #prior-art Discuss prior art, both the good and bad. # Unresolved Questions [unresolved-questions]: #unresolved-questions -- What parts of the design do you expect to be resolved before this gets merged? -- What parts of the design do you expect to be resolved through implementation of the feature? -- What related issues do you consider out of scope for this RFC that could be addressed in the future independently of the solution that comes out of this RFC? +- What will the platform schema for project.toml look like? +- Out of scope: parts of project.toml that aren't relevant to the platform api (like setting env vars) # Spec. Changes (OPTIONAL) -[spec-changes]: #spec-changesf -Does this RFC entail any proposed changes to the core specifications or extensions? If so, please document changes here. -Examples of a spec. change might be new lifecycle flags, new `buildpack.toml` fields, new fields in the buildpackage label, etc. -This section is not intended to be binding, but as discussion of an RFC unfolds, if spec changes are necessary, they should be documented here. +new platform schema look ? From 286fa8c8f973a063ef77df4a1184924149747daa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20ceylan?= Date: Tue, 17 Aug 2021 00:55:12 +0300 Subject: [PATCH 11/21] Update text/0000-project-toml-converter.md Co-authored-by: Natalie Arellano --- text/0000-project-toml-converter.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/text/0000-project-toml-converter.md b/text/0000-project-toml-converter.md index a833c08f1..b55c41436 100644 --- a/text/0000-project-toml-converter.md +++ b/text/0000-project-toml-converter.md @@ -18,7 +18,7 @@ The idea is to ship a binary with the lifecycle that would be responsible for tr * __project descriptor__ - a file that is included in the application directory to configure various behavior related to buildpacks; for more information, see the [`project.toml`](https://github.com/buildpacks/spec/blob/main/extensions/project-descriptor.md) extension specification -* __CNB_PLATFORM_API__ The Project TOML Converter will use the `CNB_PLATFORM_API` environment variable to decide which API to implement. For now, if `CNB_PLATFORM_API` is not supplied, platform API 0.3 (the currently implemented API) will be assumed, to avoid breaking existing platforms that do not currently set this environment variable. +* __CNB_PLATFORM_API__ The Project TOML Converter will use the `CNB_PLATFORM_API` environment variable to decide the target schema. The `CNB_PLATFORM_API` environment variable is set by the platform in the lifecycle's execution environment. Version 0.3 is assumed if it is not set. # Motivation [motivation]: #motivation From 76431d3d334ce676109db9f9560073f2ed89b89c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20ceylan?= Date: Tue, 17 Aug 2021 00:55:27 +0300 Subject: [PATCH 12/21] Update text/0000-project-toml-converter.md Co-authored-by: Natalie Arellano --- text/0000-project-toml-converter.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/text/0000-project-toml-converter.md b/text/0000-project-toml-converter.md index b55c41436..5375de505 100644 --- a/text/0000-project-toml-converter.md +++ b/text/0000-project-toml-converter.md @@ -25,7 +25,7 @@ The idea is to ship a binary with the lifecycle that would be responsible for tr - This feature has similarities with the "prepare" phase that has been discussed previously (see #555). But it is much smaller in scope. Potentially, the binary described in this RFC could eventually take on more responsibilities and look more like "prepare". But that is out of scope for this RFC. -- It is non-trivial for platform operators to upgrade support for different versions of project.toml. Project Descriptor is a file which describe behavior related to buildpacks. Platform operators need to give these behaviors according to developer app requests. So with this feature we are giving to developers the ability to use any version of project.toml knowing that the platform can always support it. At the same time we are giving to operators the convenience of only having to know about one schema at a time for project.toml. +- Project Descriptor (aka project.toml) is a file which describes behavior related to buildpacks. It is non-trivial for platform operators to upgrade support for different versions of project.toml. So with this feature we are giving to developers the ability to use any version of project.toml knowing that the platform can always support it. At the same time we are giving to operators the convenience of only having to know about one schema at a time for project.toml. - What is the expected outcome? From f2fa00f3c2d75089189f3035df5bc2d7c2103eeb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20ceylan?= Date: Tue, 17 Aug 2021 00:55:40 +0300 Subject: [PATCH 13/21] Update text/0000-project-toml-converter.md Co-authored-by: Natalie Arellano --- text/0000-project-toml-converter.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/text/0000-project-toml-converter.md b/text/0000-project-toml-converter.md index 5375de505..752e94c85 100644 --- a/text/0000-project-toml-converter.md +++ b/text/0000-project-toml-converter.md @@ -75,7 +75,7 @@ Why should we *not* do this? # Alternatives [alternatives]: #alternatives -- having the lifecycle process project.toml directly (like prepare phase see: #555). Prepare is not only for this problem, is kinda big and have a lot of responsibility. This RFC Topic is only focusing this problem so can be done quick and well tested. +- Having the lifecycle process project.toml directly (like prepare phase see: #555). This RFC is only focusing on the upgrade problem so that it can be done quickly. - do nothing, hope everything will be fine (We can leave as it is). We think it's too hard for platform operators to support multiple versions of project.toml. The platform API already represents the contract between the lifecycle and the platform, so it makes more sense than "project descriptor schema -> project descriptor schema" translation. - having the translator binary translate from e.g., project.toml schema 0.1 -> project.toml schema 0.2 (actually this RFC). From 2abe5fe6770fac04728ec708a30e1c47cbe14f08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20ceylan?= Date: Tue, 17 Aug 2021 00:56:04 +0300 Subject: [PATCH 14/21] Update text/0000-project-toml-converter.md Co-authored-by: Natalie Arellano --- text/0000-project-toml-converter.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/text/0000-project-toml-converter.md b/text/0000-project-toml-converter.md index 752e94c85..8b269bfe8 100644 --- a/text/0000-project-toml-converter.md +++ b/text/0000-project-toml-converter.md @@ -76,7 +76,7 @@ Why should we *not* do this? [alternatives]: #alternatives - Having the lifecycle process project.toml directly (like prepare phase see: #555). This RFC is only focusing on the upgrade problem so that it can be done quickly. -- do nothing, hope everything will be fine (We can leave as it is). We think it's too hard for platform operators to support multiple versions of project.toml. The platform API already represents the contract between the lifecycle and the platform, so it makes more sense than "project descriptor schema -> project descriptor schema" translation. +- Do nothing, hope everything will be fine (we can leave as it is). We think it's too hard for platform operators to support multiple versions of project.toml. - having the translator binary translate from e.g., project.toml schema 0.1 -> project.toml schema 0.2 (actually this RFC). # Prior Art From 91595c885e1d0423df1f4331f87ae60f317a1ddc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20ceylan?= Date: Tue, 17 Aug 2021 00:57:23 +0300 Subject: [PATCH 15/21] Apply suggestions from code review Co-authored-by: Natalie Arellano --- text/0000-project-toml-converter.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/text/0000-project-toml-converter.md b/text/0000-project-toml-converter.md index 8b269bfe8..82700bd00 100644 --- a/text/0000-project-toml-converter.md +++ b/text/0000-project-toml-converter.md @@ -65,19 +65,20 @@ foo = "bar" [metadata.fizz] buzz = ["a", "b", "c"] ``` -TODO: Which keys are platform specific ? idk maybe metadata or buildpacks order. # Drawbacks [drawbacks]: #drawbacks Why should we *not* do this? +- Another binary to maintain + # Alternatives [alternatives]: #alternatives - Having the lifecycle process project.toml directly (like prepare phase see: #555). This RFC is only focusing on the upgrade problem so that it can be done quickly. - Do nothing, hope everything will be fine (we can leave as it is). We think it's too hard for platform operators to support multiple versions of project.toml. -- having the translator binary translate from e.g., project.toml schema 0.1 -> project.toml schema 0.2 (actually this RFC). +- Having the translator binary translate from e.g., project.toml schema 0.1 -> project.toml schema 0.2. The platform API already represents the contract between the lifecycle and the platform, so it makes more sense than "project descriptor schema -> project descriptor schema" translation.. # Prior Art [prior-art]: #prior-art From 02de1f15d4cf264f525c28e7fe18dc23b0ece114 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20ceylan?= Date: Wed, 18 Aug 2021 10:07:10 +0300 Subject: [PATCH 16/21] update project toml --- text/0000-project-toml-converter.md | 39 ++++++++++++++--------------- 1 file changed, 19 insertions(+), 20 deletions(-) diff --git a/text/0000-project-toml-converter.md b/text/0000-project-toml-converter.md index a833c08f1..a7b1ca498 100644 --- a/text/0000-project-toml-converter.md +++ b/text/0000-project-toml-converter.md @@ -40,30 +40,29 @@ The Project TOML Converter is a CLI tool that will ship alongside the lifecycle. Example Project.TOML ``` [project] -id = "io.buildpacks.my-app" -version = "0.1" +id = "" # machine readable +name = "" # human readable +version = "" +authors = [""] +documentation-url = "" +source-url = "" -[build] -include = [ - "cmd/", - "go.mod", - "go.sum", - "*.go" -] - -[[build.buildpacks]] -id = "io.buildpacks/java" -version = "1.0" +[[project.licenses]] +type = "" +uri = "" +[build] +include = [""] +exclude = [""] [[build.buildpacks]] -id = "io.buildpacks/nodejs" -version = "1.0" - +id = "" +version = "" +uri = "" +[[build.env]] +name = "" +value = "" [metadata] -foo = "bar" - -[metadata.fizz] -buzz = ["a", "b", "c"] +# additional arbitrary keys allowed ``` TODO: Which keys are platform specific ? idk maybe metadata or buildpacks order. From a6e9316672944754eef0bad190267bf01f3e2bca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20ceylan?= Date: Wed, 18 Aug 2021 10:13:22 +0300 Subject: [PATCH 17/21] platform schema --- text/0000-project-toml-converter.md | 38 ++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/text/0000-project-toml-converter.md b/text/0000-project-toml-converter.md index a7b1ca498..3aca936d3 100644 --- a/text/0000-project-toml-converter.md +++ b/text/0000-project-toml-converter.md @@ -90,4 +90,40 @@ Discuss prior art, both the good and bad. - Out of scope: parts of project.toml that aren't relevant to the platform api (like setting env vars) # Spec. Changes (OPTIONAL) -new platform schema look ? +new platform schema look something like that; +``` +[project] +id = "" +version = "" + +[build] +builder = "cnbs/sample-builder:bionic" +include = [""] +exclude = [""] + +[[build.buildpacks]] +id = "io.buildpacks/java" +version = "1.0" + +[metadata] +# all metadatas here +``` + +*Here is the namespace conversions* + +For conversion to/from v0.1 +``` +project = project +build = build +build.buildpacks = build.buildpacks +metadata = metadata +``` + +For conversion to/from v0.2: + +``` +project = _ +build = io.buildpacks +build.buildpacks = io.buildpacks.group +metadata = _.metadata +``` \ No newline at end of file From a42a290ae791a51c3f964115de09ca6c2c31b25f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20ceylan?= Date: Fri, 20 Aug 2021 09:34:10 +0300 Subject: [PATCH 18/21] Update text/0000-project-toml-converter.md Co-authored-by: Natalie Arellano --- text/0000-project-toml-converter.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/text/0000-project-toml-converter.md b/text/0000-project-toml-converter.md index 0e7084954..4fe4a6d52 100644 --- a/text/0000-project-toml-converter.md +++ b/text/0000-project-toml-converter.md @@ -91,7 +91,7 @@ Discuss prior art, both the good and bad. - Out of scope: parts of project.toml that aren't relevant to the platform api (like setting env vars) # Spec. Changes (OPTIONAL) -new platform schema look something like that; +The new platform schema could look something like: ``` [project] id = "" From 9f5a350de2d6992add69c151b31bdc2aa3b333eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20ceylan?= Date: Fri, 20 Aug 2021 17:19:11 +0300 Subject: [PATCH 19/21] Update text/0000-project-toml-converter.md Co-authored-by: Natalie Arellano --- text/0000-project-toml-converter.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/text/0000-project-toml-converter.md b/text/0000-project-toml-converter.md index 4fe4a6d52..fc7618633 100644 --- a/text/0000-project-toml-converter.md +++ b/text/0000-project-toml-converter.md @@ -110,7 +110,7 @@ version = "1.0" # all metadatas here ``` -*Here is the namespace conversions* +*Here are the namespace conversions* For conversion to/from v0.1 ``` From 500de4131d0cd4e64f445a2f0a852e1ede68c51b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20ceylan?= Date: Fri, 20 Aug 2021 19:05:38 +0300 Subject: [PATCH 20/21] Update text/0000-project-toml-converter.md Co-authored-by: Natalie Arellano --- text/0000-project-toml-converter.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/text/0000-project-toml-converter.md b/text/0000-project-toml-converter.md index fc7618633..2bac5e5c2 100644 --- a/text/0000-project-toml-converter.md +++ b/text/0000-project-toml-converter.md @@ -37,7 +37,7 @@ The Project TOML Converter is a CLI tool that will ship alongside the lifecycle. # How it Works [how-it-works]: #how-it-works -Example Project.TOML +Example Project.TOML with 0.1 schema ``` [project] id = "" # machine readable From 27ba4d8a1b6f7b58b7305a3fd148c1a33586545f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20ceylan?= Date: Fri, 20 Aug 2021 19:06:35 +0300 Subject: [PATCH 21/21] last feedback --- text/0000-project-toml-converter.md | 41 +++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/text/0000-project-toml-converter.md b/text/0000-project-toml-converter.md index 2bac5e5c2..84a8a9444 100644 --- a/text/0000-project-toml-converter.md +++ b/text/0000-project-toml-converter.md @@ -65,6 +65,47 @@ value = "" # additional arbitrary keys allowed ``` + +Example Project.TOML with 0.2 schema +```` +[_] +id = "io.buildpacks.my-app" +version = "0.1" + +[_.metadata] +cdn = "https://cdn.example.com" + +[[_.metadata.assets]] +url = "https://cdn.example.com/assets/foo.jar" +checksum = "3b1b39893d8e34a6d0bd44095afcd5c4" + +buzz = ["a", "b", "c"] + +[io.buildpacks] +builder = "cnbs/sample-builder:bionic" +include = [ + "cmd/", + "go.mod", + "go.sum", + "*.go" +] + +[[io.buildpacks.group]] +id = "io.buildpacks/java" +version = "1.0" + +[[io.buildpacks.group]] +id = "io.buildpacks/nodejs" +version = "1.0" + +[[io.buildpacks.group]] +id = "example/post-build" + + [io.buildpacks.group.script] + api = "0.5" + inline = "./post-build.sh" +``` + # Drawbacks [drawbacks]: #drawbacks