Skip to content

Commit

Permalink
Update to Erlang 26.2.5.2
Browse files Browse the repository at this point in the history
Update to Erlang 26.2.5.2

Update plan.sh files to erlang26

Upgrade rebar3

Recompile Elvis and fix elvis complaints

Remove eper

    It's old and unmaintained, and now it won't compile without warnings.
    the last commit was 6-10 years ago.

    Most of the tools within it now have more updated equivalents
    elsewhere.

    Choices:

    1) just remove it
    2) fork it, fix compile errors, maintain it
    3) remove it, then when and where needed, use updated equivalents.

    For now, going with #1.

Fix compilation errors in depsolver

Fix undefined type error and syntax error.

Fix dialyzer errors

pg2 -> pg
    pg2 was removed by Erlang.

start -> ensure_started

Add {minor_version, 1} option to term_to_binary pursuant to Erlang 26 update.

    term_to_binary changed.  This option is now needed in order to maintain
    current behavior and avoid failures.

Add [{minor_version, 1}] option to all term_to_binary function calls

    It's probably not good to have some calls using this option and other
    calls not using it.

Fix /_stats API pedant test failure following update to erlang 26x

  2) /_stats API endpoint returns prometheus output ?format=text
     Failure/Error: expect(names.uniq).to match_array(PROMETHEUS_RESPONSE_TYPE_MAP.keys)

       expected collection contained:  ["chef_index_batch_completed_latency_ms_bucket", "chef_index_batch_completed_latency_ms_count", "chef... "pg_stat_tidx_blks_read", "pg_stat_toast_blks_hit", "pg_stat_toast_blks_read", "pg_stat_tup_fetch"]
       actual collection contained:    ["chef_index_batch_completed_latency_ms_bucket", "chef_index_batch_completed_latency_ms_count", "chef... "pg_stat_tidx_blks_read", "pg_stat_toast_blks_hit", "pg_stat_toast_blks_read", "pg_stat_tup_fetch"]
       the missing elements were:      ["erlang_mnesia_committed_transactions", "erlang_mnesia_failed_transactions", "erlang_mnesia_held_loc...d_transactions", "erlang_mnesia_transaction_coordinators", "erlang_mnesia_transaction_participants"]
     # ./spec/api/stats_spec.rb:218:in `block (2 levels) in <top (required)>'

Add ssl option verify_none following update to Erlang 26.

    Erlang changed this from a default option to an option which now has to
    be specified.  Not specifying it was causing failures in SSL when using
    a self-signed cert (see below).

    1) Server-side reindexing reindexing OPC it should behave like Reindexing works for all object types
       Failure/Error: identifiers.should_not include(name)
         expected ["pedant_node_test"] not to include "pedant_node_test"
       Shared Example Group: "Reindexing" called from ./spec/api/reindex_spec.rb:20
       # ./lib/pedant/rspec/search_util.rb:932:in `block in do_search'
       # ./lib/pedant/rspec/search_util.rb:769:in `with_search_polling'
       # ./lib/pedant/rspec/search_util.rb:919:in `do_search'
       # ./lib/pedant/rspec/search_util.rb:888:in `should_not_find'
       # ./lib/pedant/rspec/search_util.rb:950:in `block (2 levels) in <module:RSpec>'

Signed-off-by: Lincoln Baker <[email protected]>
  • Loading branch information
lbakerchef committed Dec 7, 2024
1 parent 31e4b3e commit b45948e
Show file tree
Hide file tree
Showing 156 changed files with 714 additions and 717 deletions.
24 changes: 13 additions & 11 deletions oc-chef-pedant/spec/api/stats_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -88,16 +88,18 @@
"pg_stat_seq_scan" => "COUNTER",
}

MNESIA_RESPONSE_TYPE_MAP = {
"erlang_mnesia_held_locks" => "GAUGE",
"erlang_mnesia_lock_queue" => "GAUGE",
"erlang_mnesia_transaction_participants" => "GAUGE",
"erlang_mnesia_transaction_coordinators" => "GAUGE",
"erlang_mnesia_failed_transactions" => "COUNTER",
"erlang_mnesia_committed_transactions" => "GAUGE",
"erlang_mnesia_logged_transactions" => "COUNTER",
"erlang_mnesia_restarted_transactions" => "COUNTER"
}
# pedant test failures here after upgrading to erlang 26x
#
#MNESIA_RESPONSE_TYPE_MAP = {
# "erlang_mnesia_held_locks" => "GAUGE",
# "erlang_mnesia_lock_queue" => "GAUGE",
# "erlang_mnesia_transaction_participants" => "GAUGE",
# "erlang_mnesia_transaction_coordinators" => "GAUGE",
# "erlang_mnesia_failed_transactions" => "COUNTER",
# "erlang_mnesia_committed_transactions" => "GAUGE",
# "erlang_mnesia_logged_transactions" => "COUNTER",
# "erlang_mnesia_restarted_transactions" => "COUNTER"
#}

CHEF_INDEX_TYPE_MAP_ES = {
"chef_elasticsearch_update_count" => "COUNTER",
Expand Down Expand Up @@ -168,7 +170,7 @@

SHARED_TYPE_MAP = ERLANG_RESPONSE_TYPE_MAP.merge(CHEF_INDEX_TYPE_MAP)
RESPONSE_TYPE_MAP = SHARED_TYPE_MAP.merge(CHEF_INDEX_JSON_TYPE_MAP)
PROMETHEUS_RESPONSE_TYPE_MAP = SHARED_TYPE_MAP.merge(MNESIA_RESPONSE_TYPE_MAP).merge(CHEF_INDEX_PROMETHEUS_TYPE_MAP)
PROMETHEUS_RESPONSE_TYPE_MAP = SHARED_TYPE_MAP.merge(CHEF_INDEX_PROMETHEUS_TYPE_MAP)

if Pedant::Config.chef_pgsql_collector
RESPONSE_TYPE_MAP = RESPONSE_TYPE_MAP.merge(PGSTATS_RESPONSE_TYPE_MAP)
Expand Down
2 changes: 1 addition & 1 deletion omnibus_overrides.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# When updating this, check doc/FrequentTasks.md for checklists to ensure all
# the various usages are updated in lockstep
#
override :erlang, version: "24.3.2"
override :erlang, version: "26.2.5.2"
override :'omnibus-ctl', version: "main"
override :chef, version: "v17.10.0"
override :ohai, version: "v16.17.0"
Expand Down
6 changes: 3 additions & 3 deletions scripts/bk_tests/bk_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ cp /workdir/scripts/bk_tests/pb_hba.conf /etc/postgresql/13/main/pg_hba.conf
# the erlang software definition lives in: /omnibus-software/config/software/erlang.rb

# this is needed until the erlang version is installed in the docker container
echo "Installing erlang 24.3.2"
asdf install erlang 24.3.2
asdf local erlang 24.3.2
echo "Installing erlang 26.2.5.2"
asdf install erlang 26.2.5.2
asdf local erlang 26.2.5.2
erl -eval 'erlang:display(erlang:system_info(otp_release)), halt().' -noshell

echo "Installing Bundler"
Expand Down
Binary file modified scripts/elvis
Binary file not shown.
4 changes: 2 additions & 2 deletions src/bookshelf/elvis.config
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
{elvis_style, no_if_expression},
{elvis_style, no_debug_call, #{ignore => [bksw_app]}},
{elvis_style, no_nested_try_catch},
{elvis_style, no_tabs},
{elvis_style, no_trailing_whitespace},
{elvis_text_style, no_tabs},
{elvis_text_style, no_trailing_whitespace},
{elvis_style, operator_spaces},
{elvis_style, used_ignored_variable},
{elvis_style, variable_naming_convention}
Expand Down
2 changes: 1 addition & 1 deletion src/bookshelf/habitat/plan.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ pkg_origin=chef
pkg_license=('Apache-2.0')
pkg_maintainer="The Chef Server Maintainers <[email protected]>"
pkg_deps=(
core/erlang24
core/erlang26
core/cacerts
core/coreutils
core/gcc-libs
Expand Down
10 changes: 6 additions & 4 deletions src/bookshelf/rebar.config
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
%% -*- tab-width: 4;erlang-indent-level: 4;indent-tabs-mode: nil -*-
%% ex: ts=4 sw=4 ft=erlang et

{require_otp_vsn, "24.3.2"}.
{require_otp_vsn, "26.2.5.2"}.

{erl_dep_retries, 10}.

Expand All @@ -16,8 +16,8 @@
{git, "https://github.com/chef/chef_secrets", {branch, "main"}}},
{envy, ".*",
{git, "https://github.com/markan/envy", {branch, "master"}}},
{eper, ".*",
{git, "https://github.com/massemanet/eper", {branch, "master"}}},
% {eper, ".*",
% {git, "https://github.com/massemanet/eper", {branch, "master"}}},
{erlcloud, ".*",
{git, "https://github.com/chef/erlcloud", {branch, "lbaker/presigned-headers"}}},
{erlsom, ".*",
Expand Down Expand Up @@ -56,6 +56,8 @@

{plugins, [pc]}.

{dialyzer, [{warnings, [no_unknown]}]}.

{xref_checks,
[undefined_function_calls,
undefined_functions,
Expand Down Expand Up @@ -132,7 +134,7 @@
{mixer, load},
syntax_tools,
compiler,
eper,
%eper,
observer_cli,
{pooler, load},
{sqerl, load}
Expand Down
4 changes: 0 additions & 4 deletions src/bookshelf/rebar.lock
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,6 @@
{git,"https://github.com/markan/envy",
{ref,"0148fb4b7ed0e188511578e98b42d6e7dde0ebd1"}},
0},
{<<"eper">>,
{git,"https://github.com/massemanet/eper",
{ref,"17b0f97ea8287b72e8ebbe7132214db182ff1a1d"}},
0},
{<<"epgsql">>,
{git,"https://github.com/chef/epgsql-1.git",
{ref,"34b4182f0e21f9189ddd7b2e290f01a9e7d93bf1"}},
Expand Down
Binary file modified src/bookshelf/rebar3
Binary file not shown.
2 changes: 1 addition & 1 deletion src/bookshelf/src/bksw_app.erl
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ start(_StartType, _StartArgs) ->
SrcDir = filename:join([Dir, "../../../../../..", "external-deps"]),
EbinDir = filename:join([Dir, "../../../../../..", "external-deps/ebin"]),
application:set_env(sync, src_dirs, {add, [{SrcDir,
[{outdir,EbinDir}]}]}),
[{outdir, EbinDir}]}]}),
application:set_env(sync, sync_method, scanner),
application:start(sync);
_ -> ok
Expand Down
4 changes: 2 additions & 2 deletions src/bookshelf/src/bksw_cleanup_task.erl
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ force_upload_cleanup() ->

init(_Args) ->
UploadInterval = envy:get(bookshelf, abandoned_upload_cleanup_interval, 19 * ?MIN_IN_MS, positive_integer),
CleanupInterval = envy:get(bookshelf,deleted_data_cleanup_interval, 7 * ?MIN_IN_MS, positive_integer),
State = #state{upload_cleanup_interval = UploadInterval, deleted_cleanup_interval = CleanupInterval} ,
CleanupInterval = envy:get(bookshelf, deleted_data_cleanup_interval, 7 * ?MIN_IN_MS, positive_integer),
State = #state{upload_cleanup_interval = UploadInterval, deleted_cleanup_interval = CleanupInterval},
spawn_timers(State),
{ok, State}.

Expand Down
8 changes: 4 additions & 4 deletions src/bookshelf/src/bksw_io.erl
Original file line number Diff line number Diff line change
Expand Up @@ -272,12 +272,12 @@ filter_entries(Bucket, Entries) ->

filter_entries(_Bucket, [], _Ex, Accum) ->
lists:reverse(Accum);
filter_entries(Bucket, [Entry|T], Ex, Accum) ->
filter_entries(Bucket, [Entry | T], Ex, Accum) ->
case re:run(Entry, Ex, [{capture, none}]) of
nomatch ->
case entry_md(Bucket, filename:basename(Entry)) of
{ok, Obj} ->
filter_entries(Bucket, T, Ex, [Obj|Accum]);
filter_entries(Bucket, T, Ex, [Obj | Accum]);
_Error ->
filter_entries(Bucket, T, Ex, Accum)
end;
Expand All @@ -301,13 +301,13 @@ make_buckets(Root, BucketDirs) ->

make_buckets(_Root, [], Buckets) ->
lists:reverse(Buckets);
make_buckets(Root, [BucketDir|T], Buckets) ->
make_buckets(Root, [BucketDir | T], Buckets) ->
Buckets1 = case file:read_file_info(filename:join([Root, BucketDir])) of
{ok, #file_info{mtime=Date}} ->
[UTC | _] = %% FIXME This is a hack until R15B
calendar:local_time_to_universal_time_dst(Date),
[#bucket{name=bksw_io_names:decode(BucketDir),
date=UTC}|Buckets];
date=UTC} | Buckets];
_Error ->
Buckets
end,
Expand Down
14 changes: 7 additions & 7 deletions src/bookshelf/src/bksw_io_names.erl
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@
-include_lib("eunit/include/eunit.hrl").
-endif.

hex2dec(X) when (X>=$0) andalso (X=<$9) -> X-$0;
hex2dec(X) when (X>=$A) andalso (X=<$F) -> X-$A+10;
hex2dec(X) when (X>=$a) andalso (X=<$f) -> X-$a+10.
hex2dec(X) when (X>=$0) andalso (X=<$9) -> X - $0;
hex2dec(X) when (X>=$A) andalso (X=<$F) -> X - $A + 10;
hex2dec(X) when (X>=$a) andalso (X=<$f) -> X - $a + 10.

-type uri() :: string() | binary().
-type hex_uri() :: string() | binary(). %% Hexadecimal encoded URI.
Expand All @@ -40,10 +40,10 @@ hex2dec(X) when (X>=$a) andalso (X=<$f) -> X-$a+10.
http_uri_decode(String) when is_list(String) ->
do_decode(String).

do_decode([$%,Hex1,Hex2|Rest]) ->
[hex2dec(Hex1)*16+hex2dec(Hex2)|do_decode(Rest)];
do_decode([First|Rest]) ->
[First|do_decode(Rest)];
do_decode([$%, Hex1, Hex2 | Rest]) ->
[hex2dec(Hex1) * 16 + hex2dec(Hex2) | do_decode(Rest)];
do_decode([First | Rest]) ->
[First | do_decode(Rest)];
do_decode([]) ->
[].

Expand Down
2 changes: 1 addition & 1 deletion src/bookshelf/src/bksw_req.erl
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,5 @@ generate_id() ->
%% it reset on node restarts -- thus we add os:timestamp/0
%% We can't use os:timestamp/0 only, since it's not guaranteed to be unique
%% in multiple invocations.
Id = term_to_binary({node(), os:timestamp(), erlang:unique_integer([positive])}),
Id = term_to_binary({node(), os:timestamp(), erlang:unique_integer([positive])}, [{minor_version, 1}]),
bksw_format:to_base64(Id).
14 changes: 7 additions & 7 deletions src/bookshelf/src/bksw_sec.erl
Original file line number Diff line number Diff line change
Expand Up @@ -157,11 +157,11 @@ const_time_compare(_, _, _) ->
false.

-spec ctcomp(string(), string(), boolean()) -> boolean().
ctcomp([ ], [ ], IsEqual) -> IsEqual;
ctcomp([ ], [_|S2], _) -> ctcomp([], S2, false );
ctcomp([_|S1], [ ], _) -> ctcomp(S1, [], false );
ctcomp([X|S1], [X|S2], IsEqual) -> ctcomp(S1, S2, IsEqual);
ctcomp([_|S1], [_|S2], _) -> ctcomp(S1, S2, false ).
ctcomp([ ], [ ], IsEqual) -> IsEqual;
ctcomp([ ], [_ | S2], _) -> ctcomp([], S2, false );
ctcomp([_ | S1], [ ], _) -> ctcomp(S1, [], false );
ctcomp([X | S1], [X | S2], IsEqual) -> ctcomp(S1, S2, IsEqual);
ctcomp([_ | S1], [_ | S2], _) -> ctcomp(S1, S2, false ).

encode_access_denied_error_response(RequestId, Req0, Context) ->
Req1 = bksw_req:with_amz_id_2(Req0),
Expand All @@ -182,7 +182,7 @@ encode_sign_error_response(AccessKeyId, IncomingSignature,

% split "<bucketname>/<key>" (possibly leading and/or trailing /) into {"bucketname", "key"}
% Path = "<bucketname>/<key>"
-spec get_bucket_key(Path::string()) -> {string(), string()}.
-spec get_bucket_key(Path :: string()) -> {string(), string()}.
get_bucket_key(Path) ->
case string:lexemes(Path, "/") of
[ ] -> {"", ""};
Expand Down Expand Up @@ -228,7 +228,7 @@ host(Req0) ->
% For example, 20150830T123600Z is a valid time stamp. Do not include milliseconds in the time stamp.
%
% 1 =< ExpiresSec =< 604800
-spec is_expired(DateTimeString::string(), ExpiresSec::integer()) -> boolean().
-spec is_expired(DateTimeString :: string(), ExpiresSec :: integer()) -> boolean().
is_expired(DateTimeString, ExpiresSec) ->
[Y1, Y2, Y3, Y4, M1, M2, D1, D2, _, H1, H2, N1, N2, S1, S2, _] = DateTimeString,
Year = list_to_integer([Y1, Y2, Y3, Y4]),
Expand Down
2 changes: 1 addition & 1 deletion src/bookshelf/src/bksw_sup.erl
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ maybe_with_cleanup_task(ChildSpecs) ->
permanent, brutal_kill, worker, [bksw_cleanup_task]},
case bksw_conf:storage_type() of
sql ->
[CleanupTask| ChildSpecs];
[CleanupTask | ChildSpecs];
_ ->
ChildSpecs
end.
Expand Down
10 changes: 5 additions & 5 deletions src/bookshelf/src/bksw_wm_base.erl
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ check_signed_headers_common(SignedHeaders, Headers) ->
[] == [Key || {Key, _} <- Headers, is_amz(Key), not proplists:is_defined(Key, SignedHeaders)].

% https://docs.aws.amazon.com/general/latest/gr/sigv4-date-handling.html
-spec get_check_date(ISO8601Date::string() | undefined, DateIfUndefined::string(), string()) -> {ok, string()} | {error, get_check_date}.
-spec get_check_date(ISO8601Date :: string() | undefined, DateIfUndefined :: string(), string()) -> {ok, string()} | {error, get_check_date}.
get_check_date(ISO8601Date, DateIfUndefined, [Y1, Y2, Y3, Y4, M1, M2, D1, D2]) ->
Date = case ISO8601Date of
undefined -> DateIfUndefined;
Expand All @@ -211,7 +211,7 @@ get_check_date(ISO8601Date, DateIfUndefined, [Y1, Y2, Y3, Y4, M1, M2, D1, D2]) -
% keys, get corresponding key-value pairs. results are undefined
% for nonexistent key(s).
%-spec get_signed_headers(proplist(), proplist(), proplist()) -> proplist(). % for erlang20+
-spec get_signed_headers(SignedHeaderKeys::[string()], Headers::[tuple()], SignedHeaders::[tuple()]) -> [tuple()].
-spec get_signed_headers(SignedHeaderKeys :: [string()], Headers :: [tuple()], SignedHeaders :: [tuple()]) -> [tuple()].
get_signed_headers([], _, SignedHeaders) -> lists:reverse(SignedHeaders);
get_signed_headers(_, [], SignedHeaders) -> lists:reverse(SignedHeaders);
get_signed_headers([Key | SignedHeaderKeys], Headers0, SignedHeaders) ->
Expand All @@ -232,8 +232,8 @@ is_amz(_) ->
parse_x_amz_credential(Cred) ->
Parse = string:split(Cred, "/", all),
case Parse of
[_access_key_id, _date, _aws_region, "s3", "aws4_request"] -> {ok, Parse};
_ -> {error, parse_x_amz_credential}
[_AccessKeyId, _Date, _AwsRegion, "s3", "aws4_request"] -> {ok, Parse};
_ -> {error, parse_x_amz_credential}
end.

% @doc split signed header string into component parts. return empty string on empty string.
Expand All @@ -243,7 +243,7 @@ parse_x_amz_signed_headers(Headers) ->
string:split(Headers, ";", all).

% @doc convert the keys of key-value pairs to lowercase strings
-spec process_headers(Headers::[tuple()]) -> [tuple()].
-spec process_headers(Headers :: [tuple()]) -> [tuple()].
process_headers(Headers) ->
[{string:casefold(
case is_atom(Key) of
Expand Down
2 changes: 1 addition & 1 deletion src/bookshelf/src/bksw_wm_object.erl
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ fully_read(Ref, Accum) ->
{ok, eof} ->
lists:reverse(Accum);
{ok, Data} ->
fully_read(Ref, [Data|Accum]);
fully_read(Ref, [Data | Accum]);
Error ->
error_logger:error_msg("Error occurred during content download: ~p~n", [Error]),
lists:reverse(Accum)
Expand Down
4 changes: 2 additions & 2 deletions src/bookshelf/src/bksw_wm_sql_object.erl
Original file line number Diff line number Diff line change
Expand Up @@ -158,12 +158,12 @@ maybe_retry(#context{sql_retry_delay = Delay, sql_retry_count = Count} = Ctx, Re
%% Return `{Obj, CtxNew}' where `Obj' is the entry meta data `#db_file{}' record or the atom
%% `error'. The `CtxNew' may have been updated and should be kept. Accessing entry md
%% through this function ensures we only ever read the md from the file system once.
-spec fetch_entry_md(#wm_reqdata{}, #context{}) -> {#db_file{}, #context{}}|{not_found, #context{}}|{error, #context{}}.
-spec fetch_entry_md(#wm_reqdata{}, #context{}) -> {#db_file{}, #context{}} | {not_found, #context{}} | {error, #context{}}.
fetch_entry_md(_Req, #context{entry_md = #db_file{} = Obj} = Ctx) ->
{Obj, Ctx};
fetch_entry_md(Req, #context{} = Ctx) ->
{ok, Bucket, Path} = bksw_util:get_object_and_bucket(Req),
case bksw_sql:find_file(Bucket,Path) of
case bksw_sql:find_file(Bucket, Path) of
{ok, #db_file{} = Object} ->
{Object, Ctx#context{entry_md = Object}};
{ok, not_found} ->
Expand Down
4 changes: 2 additions & 2 deletions src/oc_bifrost/apps/bifrost/src/bifrost_app.erl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
-module(bifrost_app).

-behaviour(application).
-export([start/2,stop/1]).
-export([start/2, stop/1]).

start(_Type, _StartArgs) ->
%% erlang 19.3.x SIGTERM changes caused runit failures.
Expand All @@ -16,7 +16,7 @@ start(_Type, _StartArgs) ->
SrcDir = filename:join([Dir, "../../../../../..", "external-deps"]),
EbinDir = filename:join([Dir, "../../../../../..", "external-deps/ebin"]),
application:set_env(sync, src_dirs, {add, [{SrcDir,
[{outdir,EbinDir}]}]}),
[{outdir, EbinDir}]}]}),
application:set_env(sync, sync_method, scanner),
application:start(sync);
_ -> ok
Expand Down
4 changes: 2 additions & 2 deletions src/oc_bifrost/apps/bifrost/src/bifrost_wm_base.erl
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ finish_request(Req, #base_state{reqid=ReqId,
PerfStats1 = case envy:get(bifrost, enable_extended_perf_log, true, boolean) of
true -> PerfStats;
false ->
[ Element || {<<"req_time">>,_} = Element <- PerfStats ]
[ Element || {<<"req_time">>, _} = Element <- PerfStats ]
end,
%% Add additional notes for the logger
Req0 = oc_wm_request:add_notes([{reqid, ReqId},
Expand All @@ -142,7 +142,7 @@ finish_request(Req, #base_state{reqid=ReqId,
%% this request.
-spec new_request_id() -> request_id().
new_request_id() ->
base64:encode(erlang:md5(term_to_binary(make_ref()))).
base64:encode(erlang:md5(term_to_binary(make_ref(), [{minor_version, 1}]))).


%% Stats Hero metrics-related functions
Expand Down
2 changes: 1 addition & 1 deletion src/oc_bifrost/apps/bifrost/src/bifrost_wm_error.erl
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ set_db_exception(Req, State, Error) ->

find_non_existent(_, []) ->
none;
find_non_existent(Type, [Head|Tail]) ->
find_non_existent(Type, [Head | Tail]) ->
case bifrost_db:exists(Type, Head) of
true ->
find_non_existent(Type, Tail);
Expand Down
2 changes: 1 addition & 1 deletion src/oc_bifrost/apps/bifrost/src/bifrost_wm_util.erl
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ scheme(Req) ->
port_string(Default) when Default =:= 80; Default =:= 443 ->
"";
port_string(Port) ->
[$:|erlang:integer_to_list(Port)].
[$: | erlang:integer_to_list(Port)].

base_uri(Req) ->
Scheme = scheme(Req),
Expand Down
4 changes: 2 additions & 2 deletions src/oc_bifrost/elvis.config
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
{elvis_style, no_if_expression},
{elvis_style, no_debug_call},
{elvis_style, no_nested_try_catch},
{elvis_style, no_tabs},
{elvis_style, no_trailing_whitespace},
{elvis_text_style, no_tabs},
{elvis_text_style, no_trailing_whitespace},
{elvis_style, operator_spaces},
{elvis_style, used_ignored_variable},
{elvis_style, variable_naming_convention}
Expand Down
2 changes: 1 addition & 1 deletion src/oc_bifrost/habitat/plan.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ pkg_origin=chef
pkg_license=('Apache-2.0')
pkg_maintainer="The Chef Server Maintainers <[email protected]>"
pkg_deps=(
core/erlang24
core/erlang26
core/cacerts
core/coreutils
core/curl
Expand Down
Loading

0 comments on commit b45948e

Please sign in to comment.