This instance will be upgraded to Heptapod 0.31.0 (final) on 2022-05-24 at 14:00 UTC+2 (a few minutes of down time)

Commit 29ff7954 authored by Georges Racinet's avatar Georges Racinet 🦑
Browse files

heptapod#574: making Heptapod 0.26 the new stable

Pipeline #28888 passed with stage
in 3 minutes and 16 seconds
......@@ -34,3 +34,4 @@
3cfed32ac2038975b533352ff0f4839aa2a0a319 heptapod-13.18.1
aefbb5e3eac5411fc526a88d3df1762ecbdc2e76 heptapod-13.19.0
b84ce63181d5c0d07585be867dbe957eb6d35348 heptapod-13.19.1
f593b81abfe52ca2083440f3f470dce3d13079da heptapod-13.19.2
......@@ -9,6 +9,11 @@
The corresponding tag is heptapod-x.y.z
## 13.19.2
- Added support for the new `NO_GIT` flag, telling Mercurial not to
use hg-git
## 13.19.1
- No actual changes
......
......@@ -80,6 +80,7 @@
"HEPTAPOD_REPOSITORY_USAGE=" + strings.Split(response.Repo, "-")[0],
// FormatBool output is "true" or "false", understood by hg config
"HEPTAPOD_HG_NATIVE=" + strconv.FormatBool(response.HgNative),
"HEPTAPOD_NO_GIT=" + strconv.FormatBool(response.NoGit),
}...)
if c.Config.Mercurial.ModulePolicy != "" {
env = append(env, "HGMODULEPOLICY=" + c.Config.Mercurial.ModulePolicy)
......
......@@ -72,4 +72,5 @@
func TestExecuteSuccessfully(t *testing.T) {
type testcase struct {
native_input *bool
no_git_input *bool
native_expected string
......@@ -75,4 +76,5 @@
native_expected string
no_git_expected string
module_policy string
}
......@@ -81,10 +83,13 @@
yes := true;
testcases := []testcase{
{native_input: nil, native_expected: "false", module_policy: "c"},
{native_input: &no, native_expected: "false", module_policy: ""},
{native_input: &yes, native_expected: "true"},
{native_input: nil, native_expected: "false", no_git_expected: "false", module_policy: "c"},
{native_input: &no, native_expected: "false", no_git_expected: "false", module_policy: ""},
{native_input: &yes, native_expected: "true", no_git_expected: "false"},
{native_input: nil, no_git_input: &yes, native_expected: "false", no_git_expected: "true", module_policy: "c"},
{native_input: &no, no_git_input: &yes, native_expected: "false", no_git_expected: "true", module_policy: ""},
{native_input: &yes, native_expected: "true", no_git_input: &yes, no_git_expected: "true"},
}
for _, tc := range testcases {
......@@ -87,8 +92,8 @@
}
for _, tc := range testcases {
requests := requesthandlers.BuildHgApiSuccessHandlers(t, tc.native_input)
requests := requesthandlers.BuildHgApiSuccessHandlers(t, tc.native_input, tc.no_git_input)
url := testserver.StartHttpServer(t, requests)
output := &bytes.Buffer{}
......@@ -128,6 +133,7 @@
require.Equal(t, "awesome-proj", fake.Env["HEPTAPOD_PROJECT_PATH"])
require.Equal(t, "my/group", fake.Env["HEPTAPOD_PROJECT_NAMESPACE_FULL_PATH"])
require.Equal(t, tc.native_expected, fake.Env["HEPTAPOD_HG_NATIVE"])
require.Equal(t, tc.no_git_expected, fake.Env["HEPTAPOD_NO_GIT"])
require.Equal(t, "/usr/share/shipped.hgrc:/etc/main.hgrc", fake.Env["HGRCPATH"])
require.Equal(t, tc.module_policy, fake.Env["HGMODULEPOLICY"])
}
......@@ -135,7 +141,7 @@
func TestIgnoreHarmfulClientArgs(t *testing.T) {
requests := requesthandlers.BuildHgApiSuccessHandlers(t, nil)
requests := requesthandlers.BuildHgApiSuccessHandlers(t, nil, nil)
url := testserver.StartHttpServer(t, requests)
output := &bytes.Buffer{}
......
......@@ -33,6 +33,7 @@
Email string `json:"gl_email"`
ProjectId int `json:"project_id"`
HgNative bool `json:"hg_native"`
NoGit bool `json:"no_git"`
StatusCode int
}
......
......@@ -50,7 +50,7 @@
return requests
}
func BuildHgApiSuccessHandlers(t *testing.T, hg_native *bool) []testserver.TestRequestHandler {
func BuildHgApiSuccessHandlers(t *testing.T, hg_native *bool, no_git *bool) []testserver.TestRequestHandler {
requests := []testserver.TestRequestHandler{
{
Path: "/api/v4/internal/hg_access",
......@@ -68,6 +68,9 @@
if (hg_native != nil) {
body["hg_native"] = *hg_native
}
if (no_git != nil) {
body["no_git"] = *no_git
}
w.WriteHeader(http.StatusOK)
require.NoError(t, json.NewEncoder(w).Encode(body))
},
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment