Skip to content

Commit

Permalink
Merge branch 'cloudfoundry/cli:main' into cloudfoundry-community/cli:…
Browse files Browse the repository at this point in the history
…v0.0.11-complete-api
  • Loading branch information
sleungcy-sap committed Apr 15, 2024
2 parents cda5ed8 + f209445 commit e41f39a
Show file tree
Hide file tree
Showing 4,165 changed files with 233,340 additions and 739,094 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
1 change: 1 addition & 0 deletions .actrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
--artifact-server-path /tmp/artifacts
24 changes: 24 additions & 0 deletions .devcontainer/cli.code-workspace
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"folders": [
{ "path": ".." },
{ "path": "../../cli-ci" },
{ "path": "../../cli-private" },
{ "path": "../../cli-workstation" }

],
"settings": {
"github-actions.workflows.pinned.workflows": [
"cli/.github/workflows/integration.yml"
]
},
"extensions": {
"recommendations": [
"gitpod.gitpod-remote-ssh",
"ms-vsliveshare.vsliveshare",
"redhat.vscode-yaml",
"golang.go",
"vscodevim.vim",
"ms-vscode.makefile-tools"
]
}
}
83 changes: 32 additions & 51 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,32 +1,19 @@
# Contributing to CLI

The Cloud Foundry team uses GitHub and accepts code contributions via [pull
requests](https://help.github.com/articles/about-pull-requests/).

## CLI v6.x & v7-beta

The code base is undergoing major work to support new Cloud Controller APIs.
Most CLI users have a v6 CLI.
Some users are trying out a beta version of v7.
Both versions are in active development.
You will find the entry point for v6 commands in the _cli/command/v6_ directory.
v7 commands are found in the _cli/command/v7_ directory.
More details are available in the [Architecture Guide](https://github.com/cloudfoundry/cli/wiki/Architecture-Guide).

**Note**: The CLI can currently be compiled to use V6 or V7 code paths.
Depending on the nature of the intended changes, you may be contributing to V6
code, V7 code, and/or shared code. The rest of this guide assumes that
your changes are to V6 code or shared code. If your changes are in V7 code, refer to the
[V7-specific contributing information](https://github.com/cloudfoundry/cli/wiki/Contributing-V7.md) for more information.
If your changes are to shared code, please also run V7 tests before submitting a
pull request.

The `make` commands in this file can be used with V6 or V7 code. To run the V7
version of tests or build the V7 version of the binary, set `TARGET_V7=1` in the
environment. If `TARGET_V7` is unset, `make` commands will target V6.
requests](https://help.github.com/articles/about-pull-requests/). If you have any questions, ask away on the #cli channel in [our Slack
community](https://slack.cloudfoundry.org/) and the
[cf-dev](https://lists.cloudfoundry.org/archives/list/cf-dev@lists.cloudfoundry.org/)
mailing list.

## CLI Versions
The cf CLI follows a branching model:
- V9 (Next major release) of the cf CLI is built from the [main branch](https://github.com/cloudfoundry/cli/tree/main). **This branch is under active development**.
- V8 of the cf CLI is built from the [v8 branch](https://github.com/cloudfoundry/cli/tree/v8). **This branch is under active development**.
- V7 of the cf CLI is built from the [v7 branch](https://github.com/cloudfoundry/cli/tree/v7). **This branch is maintenance only** and will only be updated to patch CVEs and very severe blocking defects.
- V6 of the cf CLI is built from the [v6 branch](https://github.com/cloudfoundry/cli/tree/v6). **This branch is maintenance only** and will only be updated to patch CVEs and very severe blocking defects.

## Prerequisites

Before working on a PR to the CLI code base, please:

- reach out to us first via a [GitHub issue](https://github.com/cloudfoundry/cli/issues),
Expand All @@ -43,22 +30,22 @@ After reaching out to the CLI team and the conclusion is to make a PR, please fo
that has signed [the corporate CLA](https://www.cloudfoundry.org/pdfs/CFF_Corporate_CLA.pdf).
1. Review the CF CLI [Style Guide](https://github.com/cloudfoundry/cli/wiki/CF-CLI-Style-Guide),
[Architecture Guide](https://github.com/cloudfoundry/cli/wiki/Architecture-Guide),
[Code Style Guide](https://github.com/cloudfoundry/cli/wiki/Code-Style-Guide),
[Testing Style Guide](https://github.com/cloudfoundry/cli/wiki/Testing-Style-Guide),
or [Internationalization Guide](https://github.com/cloudfoundry/cli/wiki/Internationalization-Guide).
[Product Style Guide](https://github.com/cloudfoundry/cli/wiki/CLI-Product-Specific-Style-Guide),
and [Internationalization Guide](https://github.com/cloudfoundry/cli/wiki/Internationalization-Guide).
1. Fork the project repository.
1. Create a feature branch (e.g. `git checkout -b better_cli`) and make changes on this branch
1. Create a feature branch from the earliest branch that's [appropriate for your change](#cli-versions) (e.g. `git checkout v7 && git checkout -b better_cli`) and make changes on this branch
* Follow the other sections on this page to [set up your development environment](#development-environment-setup), [build `cf`](#building-the-cf-binary) and [run the tests](#testing).
* Tests are required for any changes.
1. Push to your fork (e.g. `git push origin better_cli`) and [submit a pull request](https://help.github.com/articles/creating-a-pull-request)
1. The cf CLI team will merge your changes from the versioned branch (e.g. v7) to main for you after the PR is merged.

Note: All contributions must be sent using GitHub Pull Requests.
We prefer a small, focused pull request with a clear message
that conveys the intent of your change.

# Development Environment Setup

## Install Golang 1.12
## Install Golang 1.18

Documentation on installing GoLang can be found [here](https://golang.org/doc/install). While
the CF CLI might be compatible with other versions of GoLang, this is the only
Expand All @@ -71,36 +58,29 @@ The CF CLI requires the following development tools in order to run our test:
- [golangci-lint](https://github.com/golangci/golangci-lint) - Comprehensive linting tool
- [counterfeiter](https://github.com/maxbrunsfeld/counterfeiter) - Generate
fakes/mocks for testing. Currently using version `6.*`.
- [dep](https://github.com/golang/dep) - `vendor` dependency management tool
- [make](https://www.gnu.org/software/make/) - tool for building the CLI and
running it's tests.
running its tests.

## Git Checkout

The CF CLI should **not** be checked out under `src/github.com`, instead it
should be checked out under `src/code.cloudfoundry.org`. While they resolve to
the same thing on checkout, GoLang will be unable to _correctly_ resolve them at
build time.

Clone the repository.
```bash
mkdir -p $GOPATH/src/code.cloudfoundry.org
cd $GOPATH/src/code.cloudfoundry.org
git clone https://github.com/cloudfoundry/cli.git
```

# Building the `cf` binary

Build the binary for the **current architecture** and adding it to the `PATH`:
```bash
cd $GOPATH/src/code.cloudfoundry.org/cli
cd cli
make build
export PATH=$GOPATH/src/code.cloudfoundry.org/cli/out:$PATH # Puts the built CLI first in your PATH
export PATH=<path-to-cli-directory>/out:$PATH # Puts the built CLI first in your PATH
```

### Compiling for Other Operating Systems and Architectures

The supported platforms for the CF CLI are Linux (32-bit and 64-bit), Windows
(32-bit and 64-bit) and OSX (aka Darwin). The commands that build the binaries
The supported platforms for the CF CLI are Linux (x86, x86-64 and arm64) , Windows
(x86 and x86-64) and OSX (aka Darwin x86-64 and arm64). The commands that build the binaries
can be seen in the [Makefile](/Makefile) where the target begins with the
`out/cf-cli`.

Expand All @@ -116,13 +96,13 @@ how to cross compile binaries for other architectures.

To run the unit tests:
```bash
cd $GOPATH/src/code.cloudfoundry.org/cli
cd cli
make units-full # will run all unit tests
make units # runs all non-cf directory unit tests
```

**Note: `make units-full` is recommended over `make units` if you are unsure of
how wide reaching the intended changes are.**
how wide-reaching the intended changes are.**

## Running the Integration tests

Expand All @@ -142,16 +122,16 @@ make integration-tests # runs the isolated, push and global integration tests
make integration-tests-full # runs all the integration suites
```

If the number of parallel nodes for the non-global test suites would like to be
adjusted, set the `NODES` environment variable:
To adjust the number of parallel nodes for the non-global test suites, set the
`NODES` environment variable:

```bash
NODES=10 make integration-tests
```

# Modifying the CLI codebase

All changes to the CF CLI require updates to the unit/integration test. There
All changes to the CF CLI require updates to the unit/integration tests. There
are additional requirements around updating the CF CLI that will be listed
below.

Expand All @@ -168,6 +148,7 @@ go generate ./<package>/...
where `<package>` contains the package with the changed interface.

### Notes

1. `counterfeiter` fakes should never be manually edited. They are only
created/modified via `go generate`. **All pull requests with manually modified
fakes will be rejected.**
Expand All @@ -177,9 +158,9 @@ where `<package>` contains the package with the changed interface.

## Vendoring Dependencies

The CLI uses [`dep`](https://github.com/golang/dep) to manage vendored
dependencies. Refer to the [`dep`
documentation](https://golang.github.io/dep/docs/daily-dep.html) for managing
The CLI uses [`go modules`](https://golang.org/ref/mod) to manage
dependencies. Refer to the [`vendoring section`
documentation](https://golang.org/ref/mod#vendoring) for managing
dependencies.

If you are vendoring a new dependency, please read [License and Notice
Expand All @@ -188,7 +169,7 @@ abide by third party licenses.

## API Versioning

The CLI has a minimum version requirements for the APIs it interfaces with, the
The CLI has a minimum version requirements for the APIs it interfaces with. The
requirements for these APIs are listed in the [Version Policy
guide](https://github.com/cloudfoundry/cli/wiki/Versioning-Policy#cf-cli-minimum-supported-version).

Expand Down
12 changes: 9 additions & 3 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ about: Create a report to help us improve

**Please fill out the issue checklist below and provide ALL the requested information.**

- [ ] I reviewed open and closed github issues that may be related to my problem.
- [ ] I tried updating to the latest version of the CF CLI to see if it fixed my problem.
- [ ] I attempted to run the command with `CF_TRACE=1` to help debug the issue.
- [ ] I am reporting a bug that others will be able to reproduce.
Expand All @@ -19,16 +20,21 @@ A clear and concise description of what happen.
**Expected behavior**
A clear and concise description of what you expected to happen.

**To Reproduce**
**Exact Steps To Reproduce**
Steps to reproduce the behavior; include the exact CLI commands and verbose output:
1. Run `cf ...`
2. Bind a service `cf bind-service`
3. See error


**Provide more context**
- platform and shell details ( e.g. Mac OS X 10.11 iTerm)
- version of the CLI you are running
- version of the CC API Release you are on

Note: As of January 2019, we no longer support API versions older than CF Release v284/CF Deployment v1.7.0 (CAPI Release: 1.46.0 (APIs 2.100.0 and 3.35.0).
**Notes regarding V6 and V7 CLI support:**
- V6:
- Minimum supported version of CF Deployment: v7.0.0 (CAPI Release: 1.74.0 (APIs 2.128.0 and 3.63.0))
- Maximum supported version of CF Deployment: v13.4.0 (CAPI Release: 1.94.0 (APIs 2.149.0 and 3.84.0))
- V7:
- Minimum supported version of CF Deployment: v13.5.0 (CAPI Release: 1.95.0 (APIs 2.150.0 and 3.85.0))

3 changes: 3 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,6 @@ A clear and concise description of any alternative solutions or features you've

**Additional context**
Add any other context or screenshots about the feature request here.

**Note:**
As of the GA of the v7 CLI, the v6 line is no longer under active development and will be updated only to patch CVEs or fix severe blocking defects with no workarounds.
18 changes: 8 additions & 10 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
Thank you for contributing to the CF CLI! Please read the following:


* If you haven't yet, please review our contributing guidelines: https://github.com/cloudfoundry/cli/blob/master/.github/CONTRIBUTING.md
* Please make sure you have implemented changes in line with the [contributing guidelines](https://github.com/cloudfoundry/cli/blob/main/.github/CONTRIBUTING.md)
* We're not allowed to accept any PRs without a signed CLA, no matter how small.
If your contribution falls under a company CLA but your membership is not public, expect delays while we confirm.
* All new code requires tests to protect against regressions.
* Contributions must confirm to our [style guide](https://github.com/cloudfoundry/cli/wiki/CLI-Product-Specific-Style-Guide). Please reach out to us if you have questions.
* Contributions must be made against the appropriate branch. See the [contributing guidelines](https://github.com/cloudfoundry/cli/blob/main/.github/CONTRIBUTING.md)
* Contributions must conform to our [style guide](https://github.com/cloudfoundry/cli/wiki/CLI-Product-Specific-Style-Guide). Please reach out to us if you have questions.


## Does this PR modify CLI v6 or v7?
## Where this PR should be backported?

Please see the contribution doc above or review [Architecture Guide](https://github.com/cloudfoundry/cli/wiki/Architecture-Guide).
- [ ] [main](https://github.com/cloudfoundry/cli/tree/main) - all changes should by default start here
- [ ] [v8](https://github.com/cloudfoundry/cli/tree/v8)
- [ ] [v7](https://github.com/cloudfoundry/cli/tree/v7)

## Description of the Change


We must be able to understand the design of your change from this description.
Keep in mind that the maintainer reviewing this PR may not be familiar with or
have worked with the code here recently, so please walk us through the concepts.
Expand All @@ -24,13 +26,9 @@ have worked with the code here recently, so please walk us through the concepts.

What benefits will be realized by the code change? What users would want this change? What user need is this change addressing?

## Why Should This Be In Core?

Explain why this functionality should be in the cf CLI, as opposed to a plugin.

## Applicable Issues

List any applicable Github Issues here
List any applicable GitHub Issues here

## How Urgent Is The Change?

Expand Down
3 changes: 3 additions & 0 deletions .github/codeql/codeql-config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
paths-ignore:
- cf
- util/ui/request_logger_terminal_display.go
42 changes: 42 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
version: 2
updates:
- package-ecosystem: gomod
directory: "/"
schedule:
interval: daily
time: '11:00'
open-pull-requests-limit: 2
- package-ecosystem: gomod
directory: "/"
target-branch: "v8"
schedule:
interval: daily
time: '11:00'
open-pull-requests-limit: 2
- package-ecosystem: gomod
directory: "/"
target-branch: "v7"
schedule:
interval: daily
time: '11:00'
open-pull-requests-limit: 2
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: daily
time: '11:00'
open-pull-requests-limit: 2
- package-ecosystem: "github-actions"
directory: "/"
target-branch: "v8"
schedule:
interval: daily
time: '11:00'
open-pull-requests-limit: 2
- package-ecosystem: "github-actions"
directory: "/"
target-branch: "v7"
schedule:
interval: daily
time: '11:00'
open-pull-requests-limit: 2
36 changes: 36 additions & 0 deletions .github/license/CF_NOTICE
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
Copyright (c) 2015-Present CloudFoundry.org Foundation, Inc. All Rights Reserved.

This product contains software that is Copyright (c) 2013-2015 Pivotal Software, Inc.

This product is licensed to you under the Apache License, Version 2.0 (the "License").

You may not use this project except in compliance with the License.


Attribution notices:

This product includes software from https://github.com/cloudfoundry/cli/tree/main/vendor/code.cloudfoundry.org/gofileutils/fileutils that is:
Copyright (c) 2015-Present CloudFoundry.org Foundation, Inc. All Rights Reserved.
Copyright (c) 2014-2015 Pivotal Software, Inc.
and is licensed under the Apache License, Version 2.0.

This product includes software from https://github.com/code.cloudfoundry.org/cli/tree/main/vendor/code.cloudfoundry.org/ykk that is:
Copyright (c) 2015-Present CloudFoundry.org Foundation, Inc. All Rights Reserved.
and is licensed under the Apache License, Version 2.0.

This product includes software from https://github.com/code.cloudfoundry.org/cli/tree/main/vendor/code.cloudfoundry.org/cfnetworking-cli-api that is:
Copyright (c) 2016-Present CloudFoundry.org Foundation, Inc. All Rights Reserved.
and is licensed under the Apache License, Version 2.0.

This product includes software from https://github.com/cloudfoundry/cli/tree/main/vendor/github.com/cloudfoundry/cli-plugin-repo/web that is:
Copyright (c) 2015-Present CloudFoundry.org Foundation, Inc. All Rights Reserved.
Copyright (c) 2015 Pivotal Software, Inc.
and is licensed under the Apache License, Version 2.0.

This product includes software from https://github.com/cloudfoundry/cli/tree/main/vendor/github.com/cloudfoundry/dropsonde that is:
Copyright (c) 2014-2015 Pivotal Software, Inc.
and is licensed under the Apache License, Version 2.0.

This product includes software from https://github.com/cloudfoundry/cli/tree/main/vendor/github.com/docker/docker/pkg/term that is:
Copyright 2012-2016 Docker, Inc.
and is licensed under the Apache License, Version 2.0.
Loading

0 comments on commit e41f39a

Please sign in to comment.