Skip to content

Commit

Permalink
Fixes after rebase (elastic#15)
Browse files Browse the repository at this point in the history
* refactor

* merge left files

* fix

* fixes

* sync with refactor-tools

* rebuild

* flag redefined error

* rebase fixes

* fmt update
  • Loading branch information
narph committed Mar 3, 2022
1 parent f2e2632 commit db260be
Show file tree
Hide file tree
Showing 62 changed files with 3,597 additions and 9,137 deletions.
6 changes: 3 additions & 3 deletions .ci/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ pipeline {
cmd(label: 'check license, lint', script: 'mage check')
cmd(label: 'update', script: 'mage update')
}
//dir("${BASE_DIR}"){
// cmd(label: 'check no changes', script: 'mage checknochanges')
//}
dir("${BASE_DIR}"){
cmd(label: 'check no changes', script: 'make check-no-changes')
}
}
}
}
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/elastic-agent-project-board.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@ jobs:
with:
headers: '{"GraphQL-Features": "projects_next_graphql"}'
query: |
mutation add_to_project($projectid:String!,$contentid:String!) {
updateIssue(input: {id:$contentid, projectIds:$projectid}) {
clientMutationId
}
mutation add_to_project($projectid:String!,$contentid:String!) {
updateIssue(input: {id:$contentid, projectIds:$projectid}) {
clientMutationId
}
}
projectid: ${{ env.PROJECT_ID }}
contentid: ${{ github.event.issue.node_id }}
env:
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,11 @@ fleet.yml.old
internal/pkg/agent/operation/tests/scripts/short--1.0.yml
internal/pkg/agent/operation/tests/scripts/configurable-1.0-darwin-x86/configurable
internal/pkg/agent/operation/tests/scripts/servicable-1.0-darwin-x86/configurable
internal/pkg/agent/transpiler/tests/exec-1.0-darwin-x86_64/exec
internal/pkg/agent/operation/tests/scripts/configurable-1.0-darwin-x86_64/configurable
internal/pkg/agent/operation/tests/scripts/serviceable-1.0-darwin-x86_64/serviceable
internal/pkg/agent/application/fleet.yml
internal/pkg/agent/transpiler/tests/exec-1.0-darwin-x86_64/exec

# VSCode
/.vscode

12,343 changes: 3,489 additions & 8,854 deletions NOTICE.txt

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion deploy/kubernetes/Jenkinsfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ when:
branches: true ## for all the branches
changeset: ## when PR contains any of those entries in the changeset
- "^deploy/kubernetes/.*"
- "^libbeat/docs/version.asciidoc"
- "^version/docs/version.asciidoc"
comments: ## when PR comment contains any of those entries
- "/test deploy/kubernetes"
labels: ## when PR labels matches any of those entries
Expand Down
2 changes: 1 addition & 1 deletion deploy/kubernetes/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ALL=elastic-agent-standalone elastic-agent-managed
BEAT_VERSION=$(shell head -n 1 ../../libbeat/docs/version.asciidoc | cut -c 17- )
BEAT_VERSION=$(shell head -n 1 ../../version/docs/version.asciidoc | cut -c 17- )

.PHONY: all $(ALL)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,9 @@ import (
"os"
"text/template"

licen "github.com/elastic/elastic-agent-poc/dev-tools/license"

"github.com/elastic/elastic-agent-poc/internal/pkg/packer"
"github.com/elastic/elastic-agent-poc/licenses"
)

var (
Expand All @@ -38,13 +39,13 @@ var (

func init() {
flag.StringVar(&input, "in", "", "config to embed")
flag.StringVar(&output, "out", "-", "Output path. \"-\" means writing to stdout")
//flag.StringVar(&output, "out", "-", "Output path. \"-\" means writing to stdout")
flag.StringVar(&license, "license", "Elastic", "License header for generated file.")
}

var tmpl = template.Must(template.New("cfg").Parse(`
{{ .License }}
// Code generated by dev-tools/cmd/buildfleetcfg/buildfleetcfg.go - DO NOT EDIT.
// Code generated by dev-tools/license/buildfleetcfg/buildfleetcfg.go - DO NOT EDIT.
package application
Expand Down Expand Up @@ -77,7 +78,7 @@ func main() {
os.Exit(1)
}

l, err := licenses.Find(license)
l, err := licen.Find(license)
if err != nil {
fmt.Fprintf(os.Stderr, "problem to retrieve the license, error: %+v", err)
os.Exit(1)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ import (
"os"
"text/template"

lic "github.com/elastic/elastic-agent-poc/dev-tools/license"
"github.com/elastic/elastic-agent-poc/internal/pkg/packer"
"github.com/elastic/elastic-agent-poc/licenses"
)

var (
Expand All @@ -38,13 +38,13 @@ var (

func init() {
flag.StringVar(&input, "in", "", "Source of input. \"-\" means reading from stdin")
flag.StringVar(&output, "out", "-", "Output path. \"-\" means writing to stdout")
//flag.StringVar(&output, "out", "-", "Output path. \"-\" means writing to stdout")
flag.StringVar(&license, "license", "Elastic", "License header for generated file.")
}

var tmplPgp = template.Must(template.New("pgp").Parse(`
{{ .License }}
// Code generated by x-pack/dev-tools/cmd/buildspec/buildPgp.go - DO NOT EDIT.
// Code generated by /dev-tools/license/buildspec/buildPgp.go - DO NOT EDIT.
package release
Expand Down Expand Up @@ -77,7 +77,7 @@ func main() {
os.Exit(1)
}

l, err := licenses.Find(license)
l, err := lic.Find(license)
if err != nil {
fmt.Fprintf(os.Stderr, "problem to retrieve the license, error: %+v", err)
os.Exit(1)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,14 @@ import (
"bytes"
"flag"
"fmt"

"go/format"
"io/ioutil"
"os"
"text/template"

lic "github.com/elastic/elastic-agent-poc/dev-tools/license"
"github.com/elastic/elastic-agent-poc/internal/pkg/packer"
"github.com/elastic/elastic-agent-poc/licenses"
)

var (
Expand All @@ -38,13 +39,13 @@ var (

func init() {
flag.StringVar(&input, "in", "", "Source of input. \"-\" means reading from stdin")
flag.StringVar(&output, "out", "-", "Output path. \"-\" means writing to stdout")
//flag.StringVar(&output, "out", "-", "Output path. \"-\" means writing to stdout")
flag.StringVar(&license, "license", "Elastic", "License header for generated file.")
}

var tmpl = template.Must(template.New("specs").Parse(`
{{ .License }}
// Code generated by elastic-agent/internals/dev-tools/cmd/buildspec/buildspec.go - DO NOT EDIT.
// Code generated by elastic-agent/internals/dev-tools/buildspec/buildspec.go - DO NOT EDIT.
package program
Expand Down Expand Up @@ -84,7 +85,7 @@ func main() {
os.Exit(1)
}

l, err := licenses.Find(license)
l, err := lic.Find(license)
if err != nil {
fmt.Fprintf(os.Stderr, "problem to retrieve the license, error: %+v", err)
os.Exit(1)
Expand Down
Empty file modified dev-tools/dependencies-report
100755 → 100644
Empty file.
Empty file modified dev-tools/deploy
100755 → 100644
Empty file.
Empty file modified dev-tools/jenkins_ci.sh
100755 → 100644
Empty file.
Empty file modified dev-tools/jenkins_intake.sh
100755 → 100644
Empty file.
Empty file modified dev-tools/jenkins_release.sh
100755 → 100644
Empty file.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 2 additions & 23 deletions licenses/license_header.go → dev-tools/license/license_header.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions licenses/license.go → dev-tools/license/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
// or more contributor license agreements. Licensed under the Elastic License;
// you may not use this file except in compliance with the Elastic License.

package licenses
package license

//go:generate go run ../dev-tools/cmd/license/license_generate.go
//go:generate go run license_generate.go
6 changes: 3 additions & 3 deletions dev-tools/mage/settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const (

elasticAgentImportPath = "github.com/elastic/elastic-agent-poc"

elasticAgentModulePath = "github.com/elastic/elastic-agent-poc/v7"
elasticAgentModulePath = "github.com/elastic/elastic-agent-poc"
)

// Common settings with defaults derived from files, CWD, and environment.
Expand Down Expand Up @@ -397,9 +397,9 @@ var (
// DefaultBeatBuildVariableSources contains the default locations build
// variables are read from by Elastic Beats.
DefaultBeatBuildVariableSources = &BuildVariableSources{
BeatVersion: "{{ elastic_beats_dir }}/internal/version/version.go",
BeatVersion: "{{ elastic_beats_dir }}/version/version.go",
GoVersion: "{{ elastic_beats_dir }}/.go-version",
DocBranch: "{{ elastic_beats_dir }}/internal/docs/version.asciidoc",
DocBranch: "{{ elastic_beats_dir }}/version/docs/version.asciidoc",
}

buildVariableSources *BuildVariableSources
Expand Down
35 changes: 0 additions & 35 deletions dev-tools/mage/target/build/build.go

This file was deleted.

20 changes: 1 addition & 19 deletions dev-tools/mage/target/integtest/integtest.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ func WhitelistEnvVar(key ...string) {

// IntegTest executes integration tests (it uses Docker to run the tests).
func IntegTest() {
mg.SerialDeps(GoIntegTest, PythonIntegTest)
mg.SerialDeps(GoIntegTest)
}

// GoIntegTest executes the Go integration tests.
Expand All @@ -58,21 +58,3 @@ func GoIntegTest(ctx context.Context) error {
return devtools.GoTest(ctx, devtools.DefaultGoTestIntegrationArgs())
})
}

// PythonIntegTest executes the python system tests in the integration
// environment (Docker).
// Use PYTEST_ADDOPTS="-k pattern" to only run tests matching the specified pattern.
// Use any other PYTEST_* environment variable to influence the behavior of pytest.
func PythonIntegTest(ctx context.Context) error {
if !devtools.IsInIntegTestEnv() {
mg.SerialDeps(pythonTestDeps...)
}
runner, err := devtools.NewDockerIntegrationRunner(append(whitelistedEnvVars, devtools.ListMatchingEnvVars("PYTEST_")...)...)
if err != nil {
return err
}
return runner.Test("pythonIntegTest", func() error {
mg.Deps(devtools.BuildSystemTestBinary)
return devtools.PythonTest(devtools.DefaultPythonTestIntegrationArgs())
})
}
9 changes: 1 addition & 8 deletions dev-tools/mage/target/unittest/unittest.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func RegisterPythonTestDeps(deps ...interface{}) {

// UnitTest executes the unit tests (Go and Python).
func UnitTest() {
mg.SerialDeps(GoUnitTest, PythonUnitTest)
mg.SerialDeps(GoUnitTest)
}

// GoUnitTest executes the Go unit tests.
Expand All @@ -43,10 +43,3 @@ func GoUnitTest(ctx context.Context) error {
mg.SerialCtxDeps(ctx, goTestDeps...)
return devtools.GoTest(ctx, devtools.DefaultGoTestUnitArgs())
}

// PythonUnitTest executes the python system tests.
func PythonUnitTest() error {
mg.SerialDeps(pythonTestDeps...)
mg.Deps(devtools.BuildSystemTestBinary)
return devtools.PythonTest(devtools.DefaultPythonTestUnitArgs())
}
1 change: 1 addition & 0 deletions dev-tools/notice/overrides.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{"name": "github.com/elastic/beats/v7", "licenceType": "Elastic"}
{"name": "github.com/elastic/elastic-agent-client/v7", "licenceType": "Elastic"}
{"name": "github.com/elastic/e2e-testing", "licenceType": "Elastic"}
{"name": "github.com/gorhill/cronexpr", "licenceType": "Apache-2.0", "licenceFile":"APLv2"}
{"name": "github.com/hashicorp/cronexpr", "licenceType": "Apache-2.0", "licenceFile":"APLv2"}
{"name": "github.com/miekg/dns", "licenceType": "BSD"}
Expand Down
4 changes: 2 additions & 2 deletions dev-tools/promote_docs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def main():
check_call("git clean -dfx", shell=True)

# edit the file
with open("libbeat/docs/version.asciidoc", "r") as f:
with open("version/docs/version.asciidoc", "r") as f:
lines = f.readlines()
for i, line in enumerate(lines):
if line.startswith(":stack-version:"):
Expand All @@ -26,7 +26,7 @@ def main():
lines[i] = ":branch: {}\n".format(branch)
if line.startswith(":doc-branch:"):
lines[i] = ":doc-branch: {}\n".format(branch)
with open("libbeat/docs/version.asciidoc", "w") as f:
with open("version/docs/version.asciidoc", "w") as f:
f.writelines(lines)

check_call("make update", shell=True)
Expand Down
Empty file modified dev-tools/run_with_go_ver
100755 → 100644
Empty file.
Loading

0 comments on commit db260be

Please sign in to comment.