forked from heroku/heroku-buildpack-ruby
-
Notifications
You must be signed in to change notification settings - Fork 17
Sync with upstream v299 #105
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
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
0fa0de3
Ensure workflow uses same bundler version (#1568)
schneems 5f9b8ec
Update repo metadata (#1572)
pablotemporini dfe459b
Add observability (#1569)
schneems c4e930d
Prepare release v298 (#1573)
heroku-linguist[bot] e6ce491
Ensure flat YAML build report (#1574)
schneems 9719295
Prepare release v299 (#1575)
heroku-linguist[bot] d25ccaa
Merge tag 'v299' into deps/upstream_v299
Frzk fe6bd05
chore: fix report path and remove specs
Frzk File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| #!/usr/bin/env bash | ||
|
|
||
| set -euo pipefail | ||
|
|
||
| CACHE_DIR="${2}" | ||
| REPORT_FILE="${CACHE_DIR}/.scalingo/ruby/build_report.yml" | ||
|
|
||
| # Whilst the release file is always written by the buildpack, some apps use | ||
| # third-party slug cleaner buildpacks to remove this and other files, so we | ||
| # cannot assume it still exists by the time the release step runs. | ||
| if [[ -f "${REPORT_FILE}" ]]; then | ||
| cat "${REPORT_FILE}" | ||
| fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,73 @@ | ||
| require 'yaml' | ||
| require 'pathname' | ||
|
|
||
| # Observability reporting for builds | ||
| # | ||
| # Example usage: | ||
| # | ||
| # HerokuBuildReport::GLOBAL.capture( | ||
| # "ruby_version" => "3.4.2" | ||
| # ) | ||
| module HerokuBuildReport | ||
| # Accumulates data in memory and writes it to the specified path in YAML format | ||
| # | ||
| # Writes data to disk on every capture. Later `bin/report` emits the disk contents | ||
| class YamlReport | ||
| attr_reader :data | ||
|
|
||
| def initialize(path: ) | ||
| @path = Pathname(path).expand_path | ||
| @path.dirname.mkpath | ||
| FileUtils.touch(@path) | ||
| @data = {} | ||
| end | ||
|
|
||
| def clear! | ||
| @data.clear | ||
| @path.write("") | ||
| end | ||
|
|
||
| def complex_object?(value) | ||
| value.to_yaml.match?(/!ruby\/object:/) | ||
| end | ||
|
|
||
| def capture(metrics = {}) | ||
| metrics.each do |(key, value)| | ||
| return if key.nil? || key.to_s.strip.empty? | ||
|
|
||
| key = key&.strip | ||
| raise "Key cannot be empty (#{key.inspect} => #{value})" if key.nil? || key.empty? | ||
|
|
||
| # Don't serialize complex values by accident | ||
| if complex_object?(value) | ||
| value = value.to_s | ||
| end | ||
|
|
||
| @data["#{key}"] = value | ||
| end | ||
|
|
||
| @path.write(@data.to_yaml) | ||
| end | ||
| end | ||
|
|
||
| # Current load order of the various "language packs" | ||
| def self.set_global(path: ) | ||
| YamlReport.new(path: path).tap { |report| | ||
| # Silence warning about setting a constant | ||
| begin | ||
| old_verbose = $VERBOSE | ||
| $VERBOSE = nil | ||
| const_set(:GLOBAL, report) | ||
| ensure | ||
| $VERBOSE = old_verbose | ||
| end | ||
| } | ||
| end | ||
|
|
||
| # Stores data in memory only, does not persist to disk | ||
| def self.dev_null | ||
| YamlReport.new(path: "/dev/null") | ||
| end | ||
|
|
||
| GLOBAL = self.dev_null # Changed via `set_global` | ||
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,6 +2,6 @@ | |
|
|
||
| module LanguagePack | ||
| class LanguagePack::Base | ||
| BUILDPACK_VERSION = "v297" | ||
| BUILDPACK_VERSION = "v299" | ||
| end | ||
| end | ||
This file was deleted.
Oops, something went wrong.
Empty file.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
haha interesting changelog :D