Skip to content

Commit

Permalink
flattening go dir (#1)
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Hoang <[email protected]>
  • Loading branch information
mike-hoang authored Jun 30, 2023
1 parent 15ff51f commit 00e6c0d
Show file tree
Hide file tree
Showing 82 changed files with 212 additions and 263 deletions.
22 changes: 4 additions & 18 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# This workflow will build a Java project with Maven
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven

name: CI
on:
push:
Expand All @@ -11,10 +8,6 @@ on:
jobs:
build:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./go

steps:
- uses: actions/checkout@v3

Expand All @@ -23,19 +16,13 @@ jobs:
with:
go-version: '1.19'

- name: Set envs
run: |
go env -w GOPATH=$GITHUB_WORKSPACE
go env -w GO111MODULE=auto
- name: Check go mod status
run: |
make gomod_tidy
if [[ ! -z $(git status -s) ]]
then
echo "Go mod state is not clean"
git diff "$GITHUB_SHA"
exit 1
STATUS=$(git status --porcelain go.mod go.sum)
if [ ! -z "$STATUS" ]; then
echo "Running go mod tidy modified go.mod and/or go.sum"
exit 1
fi
- name: Build binary
Expand All @@ -45,7 +32,6 @@ jobs:
run: make test

- name: Run Gosec Security Scanner
working-directory: ./
run: |
export PATH=$PATH:$(go env GOPATH)/bin
go install github.com/securego/gosec/v2/cmd/[email protected]
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ jobs:
echo "GOARCH=$GOARCH" >> $GITHUB_ENV
- name: Build
run: |
cd go/
go build -o "$BINARY_NAME" -v
- name: Release with Notes and Binaries
uses: softprops/action-gh-release@v1
Expand Down
8 changes: 0 additions & 8 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,3 @@ nb-configuration.xml

# Local environment
.env

# node
lib/
node_modules/
.npmignore

# Go
/pkg/
6 changes: 0 additions & 6 deletions .snyk

This file was deleted.

File renamed without changes.
23 changes: 11 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
# Alizer

![Go](https://img.shields.io/badge/Go-1.19-blue)
![Build status](https://github.com/redhat-developer/alizer/actions/workflows/CI.yml/badge.svg)
[![Build status](https://github.com/devfile/alizer/actions/workflows/CI.yml/badge.svg)](https://github.com/devfile/alizer/actions/workflows/CI.yml)
[![License](https://img.shields.io/badge/License-Apache%202.0-orange.svg)](./LICENSE)

Alizer (which stands for Application Analyzer) is a utilily whose goal is to extract informations about an application source code.
Such informations are:
Alizer (which stands for Application Analyzer) is a utility whose goal is to extract information about an application source code.
Such information are:

- Programming languages.
- Frameworks.
- Tools used to build the application.

Additionaly, Alizer can also select one devfile (cloud workspace file) from a list of available devfiles and/or
Additionally, Alizer can also select one devfile (cloud workspace file) from a list of available devfiles and/or
detect components (the concept of component is taken from Odo and its definition can be read on [odo.dev](https://odo.dev/docs/getting-started/basics/#component)).

## Usage
Expand All @@ -21,7 +21,6 @@ detect components (the concept of component is taken from Odo and its definition
The Go CLI can be built with the below command:

```bash
# inside the go/ dir
$ go build alizer.go
```

Expand Down Expand Up @@ -64,7 +63,7 @@ $ go build alizer.go
To analyze your source code with Alizer, just import it and use the recognizer:

```go
import "github.com/redhat-developer/alizer/pkg/apis/recognizer"
import "github.com/devfile/alizer/pkg/apis/recognizer"

languages, err := recognizer.Analyze("your/project/path")
```
Expand All @@ -79,7 +78,7 @@ It detects all components which are found in the source tree where each componen
- _Ports_: list of ports used by the component

```go
import "github.com/redhat-developer/alizer/pkg/apis/recognizer"
import "github.com/devfile/alizer/pkg/apis/recognizer"

components, err := recognizer.DetectComponents("your/project/path")
```
Expand All @@ -93,7 +92,7 @@ For more info about port detection, see the [port detection](docs/public/port_de
It selects a devfile from a list of devfiles (from a devfile registry or other storage) based on the information found in the source tree.

```go
import "github.com/redhat-developer/alizer/pkg/apis/recognizer"
import "github.com/devfile/alizer/pkg/apis/recognizer"

devfile, err := recognizer.SelectDevFileFromTypes("your/project/path", devfiles)
```
Expand Down Expand Up @@ -158,7 +157,7 @@ For information on getting started, refer to the [CONTRIBUTING instructions](CON

## Release process

The release process of `alizer` is very straightforward. You can create a new release [here](https://github.com/redhat-developer/alizer/releases/new).
The release process of `alizer` is very straightforward. You can create a new release [here](https://github.com/devfile/alizer/releases/new).

- The _title_ of the release has to be the new version. `Alizer` follows the `v{major}.{minor}.{bugfix}` format (e.g `v0.1.0`)
- The _description_ of the release is optional. You may add a description if there were outstanding updates in the project, not mentioned in the issues or PRs of this release.
Expand All @@ -172,11 +171,11 @@ For each release a group of binary files is generated. More detailed we have the
- `darwin/amd64`

In order to download a binary file:
* Go to the release you are interested for `https://github.com/thepetk/alizer/releases/tag/<release-tag>`
* Go to the release you are interested for `https://github.com/devfile/alizer/releases/tag/<release-tag>`
* In the **Assets** section you will see the list of generated binaries for the release.

## Feedback & Questions

If you discover an issue please file a bug and we will fix it as soon as possible.
If you discover an issue please file a bug, and we will fix it as soon as possible.

- File a bug in [GitHub Issues](https://github.com/redhat-developer/alizer/issues).
Issues are tracked in the [devfile/api](https://github.com/devfile/api) repo with the label [area/alizer](https://github.com/devfile/api/issues?q=is%3Aopen+is%3Aissue+label%3Aarea%2Falizer)
4 changes: 2 additions & 2 deletions go/alizer.go → alizer.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"flag"
"os"

"github.com/redhat-developer/alizer/go/pkg/cli"
"github.com/redhat-developer/alizer/go/pkg/utils"
"github.com/devfile/alizer/pkg/cli"
"github.com/devfile/alizer/pkg/utils"
)

func main() {
Expand Down
2 changes: 1 addition & 1 deletion docs/proposals/support_22x_devfiles.md
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ _We have to keep the old way of fetching devfiles from library in order to ensur
### recognizer.MatchDevfiles
This function will take 3 parameters `(path string, devFileTypes []model.DevFileType, filter map[string]interface{})`. If someone wants to filter the selected devfiles for specific version range the have to write:
```golang
import "github.com/redhat-developer/alizer/pkg/apis/recognizer"
import "github.com/devfile/alizer/pkg/apis/recognizer"
filter := map[string]interface{} {
"max-version": "2.1.0",
"min-version": "2.0.0",
Expand Down
46 changes: 23 additions & 23 deletions go/go.mod → go.mod
Original file line number Diff line number Diff line change
@@ -1,63 +1,63 @@
module github.com/redhat-developer/alizer/go
module github.com/devfile/alizer

go 1.19

require (
github.com/go-git/go-git/v5 v5.5.1
github.com/go-git/go-git/v5 v5.7.0
github.com/go-logr/logr v1.2.4
github.com/moby/buildkit v0.10.6
github.com/moby/buildkit v0.11.6
github.com/pkg/errors v0.9.1
github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06
github.com/spf13/cobra v1.7.0
github.com/spf13/pflag v1.0.5
github.com/stretchr/testify v1.8.1
go.uber.org/zap v1.24.0
golang.org/x/mod v0.10.0
golang.org/x/mod v0.11.0
gopkg.in/yaml.v3 v3.0.1
sigs.k8s.io/controller-runtime v0.15.0
)

require (
github.com/Microsoft/go-winio v0.6.1 // indirect
github.com/ProtonMail/go-crypto v0.0.0-20230417170513-8ee5748c52b5 // indirect
github.com/ProtonMail/go-crypto v0.0.0-20230626094100-7e9e0395ebec // indirect
github.com/acomagu/bufpipe v1.0.4 // indirect
github.com/cloudflare/circl v1.3.2 // indirect
github.com/cloudflare/circl v1.3.3 // indirect
github.com/containerd/typeurl v1.0.2 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/emirpasic/gods v1.18.1 // indirect
github.com/go-git/gcfg v1.5.0 // indirect
github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect
github.com/go-git/go-billy/v5 v5.4.1 // indirect
github.com/go-logr/zapr v1.2.4 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/google/gofuzz v1.1.0 // indirect
github.com/imdario/mergo v0.3.15 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/google/gofuzz v1.2.0 // indirect
github.com/imdario/mergo v0.3.16 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/kevinburke/ssh_config v1.2.0 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/pjbgf/sha1cd v0.2.3 // indirect
github.com/pjbgf/sha1cd v0.3.0 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/rogpeppe/go-internal v1.10.0 // indirect
github.com/sergi/go-diff v1.3.1 // indirect
github.com/skeema/knownhosts v1.1.0 // indirect
github.com/skeema/knownhosts v1.1.1 // indirect
github.com/xanzy/ssh-agent v0.3.3 // indirect
go.uber.org/atomic v1.7.0 // indirect
go.uber.org/multierr v1.6.0 // indirect
golang.org/x/crypto v0.8.0 // indirect
golang.org/x/net v0.10.0 // indirect
golang.org/x/sys v0.8.0 // indirect
golang.org/x/text v0.9.0 // indirect
golang.org/x/tools v0.9.1 // indirect
google.golang.org/protobuf v1.30.0 // indirect
go.uber.org/atomic v1.11.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
golang.org/x/crypto v0.10.0 // indirect
golang.org/x/net v0.11.0 // indirect
golang.org/x/sys v0.9.0 // indirect
golang.org/x/text v0.10.0 // indirect
golang.org/x/tools v0.10.0 // indirect
google.golang.org/protobuf v1.31.0 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/warnings.v0 v0.1.2 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
k8s.io/apimachinery v0.27.2 // indirect
k8s.io/klog/v2 v2.90.1 // indirect
k8s.io/utils v0.0.0-20230209194617-a36077c30491 // indirect
k8s.io/apimachinery v0.27.3 // indirect
k8s.io/klog/v2 v2.100.1 // indirect
k8s.io/utils v0.0.0-20230505201702-9f6742963106 // indirect
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect
)
Loading

0 comments on commit 00e6c0d

Please sign in to comment.