Skip to content

Commit

Permalink
chore: fix spelling (#1127)
Browse files Browse the repository at this point in the history
* chore: fix spelling

* Regen. i18n_resources.go

Co-authored-by: Matt Rutkowski <mrutkowski@apache.org>
  • Loading branch information
jbampton and mrutkows authored Mar 26, 2021
1 parent 03df112 commit d653592
Show file tree
Hide file tree
Showing 22 changed files with 124 additions and 355 deletions.
4 changes: 2 additions & 2 deletions deployers/deploymentreader_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ func testLoadAndBindDeploymentYAML(t *testing.T, path string, triggerName string
dReader := NewDeploymentReader(sDeployer)
err := dReader.HandleYaml()

// DEBUG() Uncomment to display initial DeploymentDescriptor (manifest, deployemnt befopre binding)
// DEBUG() Uncomment to display initial DeploymentDescriptor (manifest, deployment before binding)
//fmt.Println(utils.ConvertMapToJSONString("BEFORE: dReader.DeploymentDescriptor", dReader.DeploymentDescriptor))
//fmt.Println(utils.ConvertMapToJSONString("BEFORE: sDeployer.Deployment", sDeployer.Deployment))

Expand Down Expand Up @@ -131,7 +131,7 @@ func TestDeploymentReader_ProjectBindTrigger(t *testing.T) {
// Create an annotation (in manifest representation) with key we expect, with value that should be overwritten
TEST_ANNOTATION := whisk.KeyValue{TEST_ANNOTATION_KEY, "foo"}

// create ServicedEployer
// create ServiceDeployer
sDeployer, dReader := testLoadAndBindDeploymentYAML(t, TEST_DATA, TEST_TRIGGER, TEST_ANNOTATION)

// test Project exists with expected name in Deployment file
Expand Down
2 changes: 1 addition & 1 deletion deployers/whiskclient_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -282,5 +282,5 @@ func TestNewWhiskConfigWithAdditionalHeaders(t *testing.T) {
newHeaderValue := "NewValue"
AddAdditionalHeader(newHeader, newHeaderValue)
config, _ := NewWhiskConfig(propPath, deploymentPath, manifestPath)
assert.Equal(t, newHeaderValue, config.AdditionalHeaders.Get(newHeader), "Failed to set an addtional header")
assert.Equal(t, newHeaderValue, config.AdditionalHeaders.Get(newHeader), "Failed to set an additional header")
}
2 changes: 1 addition & 1 deletion docs/sync_projects_between_client_and_server.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ whisk-managed:

> Where the text “OpenWhisk” is a constant prefix and “\0” is the NULL character. The <size_of_manifest_file> and <contents_of_manifest_file> vary depending on the file.
Now, subsequent deployments of the same project in `sync` mode, calculates a new `projectHash` on client and compares it with the one on the server for every entity in that project. This comparision could lead us to following two scenarios:
Now, subsequent deployments of the same project in `sync` mode, calculates a new `projectHash` on client and compares it with the one on the server for every entity in that project. This comparison could lead us to following two scenarios:

* **Scenario 1:** If `projectHash` on client is same as `projectHash` on the server i.e. there were no changes in the project on the client side, the project on server side is left as is except wskdeploy redeploys all the entities from manifest file to capture any changes in deployment file.

Expand Down
2 changes: 1 addition & 1 deletion docs/wskdeploy_action_env_var_parms.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ In this example:
- we further demonstrated how string values from environment variables could be concatenated with other strings within a Manifest file

### Notes:
- These methods for binidng environment variables to input parameters are also available within Deployment files.
- These methods for binding environment variables to input parameters are also available within Deployment files.

### Source code
The manifest file for this example can be found here:
Expand Down
4 changes: 2 additions & 2 deletions docs/wskdeploy_apigateway_http.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,9 @@ Because a HTTP response disables the API Gateway default handling, you have to p
- a `body` field that contains your normal payload,
- an optional `headers` field that includes any HTTP header you want to set, typically `Content-Type`.

If you don't provide this structure, the API Gateway will generate a HTTP response with status code `204: No Content` and an empty body. If this occurs when it shouldn't, it's probably a sign that you have a HTTP response specified with the gateway but the undelying action doesn't return this structure.
If you don't provide this structure, the API Gateway will generate a HTTP response with status code `204: No Content` and an empty body. If this occurs when it shouldn't, it's probably a sign that you have a HTTP response specified with the gateway but the underlying action doesn't return this structure.

When you want to return an error, you need to provide the same structure wrapped into an `error` object. If you don't wrap it into an `error` object, it will still work from an HTTP prespective but OpenWhisk will not recognise it as an error.
When you want to return an error, you need to provide the same structure wrapped into an `error` object. If you don't wrap it into an `error` object, it will still work from an HTTP perspective but OpenWhisk will not recognise it as an error.

This structure will work with any language that is supported by OpenWhisk, such as python or Java. If you are using JavaScript, you can make use of `Promise.resolve` and `Promise.reject` to make your code more readable by removing the need for the `error` wrapper:

Expand Down
2 changes: 1 addition & 1 deletion docs/wskdeploy_apigateway_http_sequence.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ You should then see a JSON response with status code `200` and the following res

### Discussion

By combining HTTP responses and sequences, you can re-use existing actions that are not designed to return HTTP responses by adding the necesary wrapper to the final result. You need to be careful how errors are handled as they will short-circuit the sequence execution and return early.
By combining HTTP responses and sequences, you can re-use existing actions that are not designed to return HTTP responses by adding the necessary wrapper to the final result. You need to be careful how errors are handled as they will short-circuit the sequence execution and return early.

### Source code
The source code for the manifest and JavaScript files can be found here:
Expand Down
2 changes: 1 addition & 1 deletion docs/wskdeploy_apigateway_open_api_spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ There are two major differences from _"Hello World" API_ example:
- the root key is now project as the open api specification is a project wide concept.
- a new `config` key specifying where the Open API Specification is located.

The `config` key under `project` in the manifest file specifies where the Open API Specification is located. The keyword `config` was chosen to remain consistent with the `config-file` terminology in OpenWhisk CLI flag option. The Open API Specification describes in a JSON document the the base path, endpoint, HTTP verb, and other details describing the API. For example, the document above describes a GET endpoint at `/hello/world` that recieves JSON as input and returns JSON as output.
The `config` key under `project` in the manifest file specifies where the Open API Specification is located. The keyword `config` was chosen to remain consistent with the `config-file` terminology in OpenWhisk CLI flag option. The Open API Specification describes in a JSON document the the base path, endpoint, HTTP verb, and other details describing the API. For example, the document above describes a GET endpoint at `/hello/world` that receives JSON as input and returns JSON as output.

### Deploying

Expand Down
2 changes: 1 addition & 1 deletion docs/wskdeploy_faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

### What is the order of precedence for OpenWhisk credentials?

- The ```wskdeploy``` utility finds the credentials (apihost, namespace, and auth) as well as the APIGW_ACCESS_TOKEN in the folowing precedence from highest to lowest:
- The ```wskdeploy``` utility finds the credentials (apihost, namespace, and auth) as well as the APIGW_ACCESS_TOKEN in the following precedence from highest to lowest:
- ```wskdeploy``` command line (i.e. ```wskdeploy --apihost --namespace --auth```)
- The deployment file
- The manifest file
Expand Down
4 changes: 2 additions & 2 deletions docs/wskdeploy_sequence_basic.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

## Creating a basic Action sequence

OpenWhisk supports creating a new, named composite action from sequencung multiple, compatible Actions.
OpenWhisk supports creating a new, named composite action from sequencing multiple, compatible Actions.

This example:
- Shows how to use a Manifest to sequence three actions together to:
Expand Down Expand Up @@ -180,7 +180,7 @@ params: {
"job": "gentleman"
}
```
the input paramaters are augmented by the first Action in the sequence to produce the output "member" object:
the input parameters are augmented by the first Action in the sequence to produce the output "member" object:

```json
member: {
Expand Down
2 changes: 1 addition & 1 deletion parsers/manifest_parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -660,7 +660,7 @@ func (dm *YAMLParser) readActionFunction(manifestFilePath string, manifestFileNa

if utils.IsDirectory(actionFilePath) {
zipFileName = actionFilePath + "." + runtimes.ZIP_FILE_EXTENSION
err := utils.NewZipWritter(actionFilePath, zipFileName, action.Include, action.Exclude, filepath.Dir(manifestFilePath)).Zip()
err := utils.NewZipWriter(actionFilePath, zipFileName, action.Include, action.Exclude, filepath.Dir(manifestFilePath)).Zip()
if err != nil {
return actionFilePath, nil, err
}
Expand Down
2 changes: 1 addition & 1 deletion specification/html/spec_packages.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ my_whisk_package:
version: 1.2.0
license: Apache-2.0
actions:
my_awsome_action:
my_awesome_action:
<Action schema>
triggers:
trigger_for_awesome_action:
Expand Down
2 changes: 1 addition & 1 deletion specification/html/spec_rule.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ The Rule entity schema contains the information necessary to associates one trig

### Requirements
- The Rule name (i.e., <ruleName>) MUST be less than or equal to 256 characters.
- The Rule entity schema includes all general [Entity Schem](#TBD) fields in addition to any fields
- The Rule entity schema includes all general [Entity Schema](#TBD) fields in addition to any fields
declared above.

### Notes
Expand Down
2 changes: 1 addition & 1 deletion specification/html/spec_trigger.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ The Trigger entity schema contains the necessary information to describe the str
<p>N/A</p>
</td>
<td>
<p>The optional credential used to acces the feed service.</p>
<p>The optional credential used to access the feed service.</p>
</td>
</tr>
<tr>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ function stopTracking(pullRequest, ifInState) {
})
.then (function () {
return {
message: "Sucessfully stopped tracking " + id
message: "Successfully stopped tracking " + id
};
});
} else {
Expand Down Expand Up @@ -240,7 +240,7 @@ function prIsTooOld(prDoc) {
var moment = require("moment");
// read lastUpdate from github
var readyMoment = moment(prDoc.lastUpdate);
// depeneding on the state of pull request, "READY" or "REVIEW"
// depending on the state of pull request, "READY" or "REVIEW"
// read the limit amount and days
var limit = limits[prDoc.state];
// moment.diff() returns difference between today and
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ function stopTracking(pullRequest, ifInState) {
})
.then (function () {
return {
message: "Sucessfully stopped tracking " + id
message: "Successfully stopped tracking " + id
};
});
} else {
Expand Down
2 changes: 1 addition & 1 deletion utils/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func isFile(path string) (bool, error) {
return true, nil
}
}
// stat returned an error and here we are chekcking if it was os.PathError
// stat returned an error and here we are checking if it was os.PathError
if !os.IsNotExist(err) {
return false, nil
}
Expand Down
2 changes: 1 addition & 1 deletion utils/misc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ func TestDependencies(t *testing.T) {
func TestNewZipWriter(t *testing.T) {
filePath := "../tests/src/integration/zipaction/actions/cat"
zipName := filePath + ".zip"
err := NewZipWritter(filePath, zipName, make([][]string, 0), make([]string, 0), "").Zip()
err := NewZipWriter(filePath, zipName, make([][]string, 0), make([]string, 0), "").Zip()
defer os.Remove(zipName)
assert.Equal(t, nil, err, "zip folder error happened.")
}
2 changes: 1 addition & 1 deletion utils/validation.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ var license_json = LicenseJSON{}
//Check local data record at first
//Then check remote json data
func CheckLicense(license string) bool {
// TODO(#673) Strict flag should cause an error to be generatd
// TODO(#673) Strict flag should cause an error to be generated
if !LicenseLocalValidation(license) && !LicenseRemoteValidation(license) {
warningString := wski18n.T(
wski18n.ID_WARN_KEYVALUE_INVALID,
Expand Down
24 changes: 12 additions & 12 deletions utils/zip.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ import (
const PATH_WILDCARD = "*"
const ONE_DIR_UP = "../"

func NewZipWritter(src string, des string, include [][]string, exclude []string, manifestFilePath string) *ZipWritter {
zw := &ZipWritter{
func NewZipWriter(src string, des string, include [][]string, exclude []string, manifestFilePath string) *ZipWriter {
zw := &ZipWriter{
src: src,
des: des,
include: include,
Expand All @@ -43,22 +43,22 @@ func NewZipWritter(src string, des string, include [][]string, exclude []string,
return zw
}

type ZipWritter struct {
type ZipWriter struct {
src string
des string
include [][]string
exclude []string
excludedFiles map[string]bool
manifestFilePath string
zipWritter *zip.Writer
zipWriter *zip.Writer
}

type Include struct {
source string
destination string
}

func (zw *ZipWritter) zipFile(path string, f os.FileInfo, err error) error {
func (zw *ZipWriter) zipFile(path string, f os.FileInfo, err error) error {
var file *os.File
var wr io.Writer
var verboseMsg string
Expand All @@ -85,7 +85,7 @@ func (zw *ZipWritter) zipFile(path string, f os.FileInfo, err error) error {
defer file.Close()

fileName := strings.TrimPrefix(path, zw.src+"/")
if wr, err = zw.zipWritter.Create(fileName); err != nil {
if wr, err = zw.zipWriter.Create(fileName); err != nil {
return err
}

Expand All @@ -100,7 +100,7 @@ func (zw *ZipWritter) zipFile(path string, f os.FileInfo, err error) error {
return nil
}

func (zw *ZipWritter) buildIncludeMetadata() ([]Include, error) {
func (zw *ZipWriter) buildIncludeMetadata() ([]Include, error) {
var includeInfo []Include
var listOfSourceFiles []string
var err error
Expand Down Expand Up @@ -220,7 +220,7 @@ func (zw *ZipWritter) buildIncludeMetadata() ([]Include, error) {
return includeInfo, nil
}

func (zw *ZipWritter) buildExcludeMetadata() error {
func (zw *ZipWriter) buildExcludeMetadata() error {
var err error
for _, exclude := range zw.exclude {
exclude = filepath.Join(zw.manifestFilePath, exclude)
Expand All @@ -231,7 +231,7 @@ func (zw *ZipWritter) buildExcludeMetadata() error {
return err
}

func (zw *ZipWritter) findExcludedIncludedFiles(functionPath string, flag bool) error {
func (zw *ZipWriter) findExcludedIncludedFiles(functionPath string, flag bool) error {
var err error
var files []string
var excludedFiles []string
Expand Down Expand Up @@ -266,7 +266,7 @@ func (zw *ZipWritter) findExcludedIncludedFiles(functionPath string, flag bool)
return err
}

func (zw *ZipWritter) Zip() error {
func (zw *ZipWriter) Zip() error {

var zipFile *os.File
var err error
Expand All @@ -286,7 +286,7 @@ func (zw *ZipWritter) Zip() error {
wskprint.PrintlnOpenWhiskVerbose(Flags.Verbose, verboseMsg)

// creating a new zip writter for greeting.zip
zw.zipWritter = zip.NewWriter(zipFile)
zw.zipWriter = zip.NewWriter(zipFile)

// build a map of file names and bool indicating whether the file is included or excluded
// iterate over the directory specified in "function", find the list of files and mark them as not excluded
Expand Down Expand Up @@ -342,7 +342,7 @@ func (zw *ZipWritter) Zip() error {

// now close the zip file greeting.zip as all the included items
// are added into the zip file along with the action root dir
if err = zw.zipWritter.Close(); err != nil {
if err = zw.zipWriter.Close(); err != nil {
return err
}

Expand Down
2 changes: 1 addition & 1 deletion wskenv/environment_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func TestInterpolateStringWithEnvVar(t *testing.T) {
assert.Equal(t, "NoDollar", InterpolateStringWithEnvVar("NoDollar"), "NoDollar should be no change.")
assert.Equal(t, "oh, dollars!", InterpolateStringWithEnvVar("$WithDollar"), "dollar sign should be handled.")
assert.Equal(t, "5000", InterpolateStringWithEnvVar("5000"), "Should be no difference between integer and string.")
assert.Equal(t, "", InterpolateStringWithEnvVar("$WithDollarAgain"), "if not found in environemnt, return empty string.")
assert.Equal(t, "", InterpolateStringWithEnvVar("$WithDollarAgain"), "if not found in environment, return empty string.")
assert.Equal(t, "oh, dollars!.ccc.aaa", InterpolateStringWithEnvVar("${WithDollar}.ccc.aaa"), "String concatenation fail")
assert.Equal(t, "ddd.NO dollar.aaa", InterpolateStringWithEnvVar("ddd.${NoDollar}.aaa"), "String concatenation fail")
assert.Equal(t, "oh, dollars!.NO dollar.aaa", InterpolateStringWithEnvVar("${WithDollar}.${NoDollar}.aaa"), "String concatenation fail")
Expand Down
Loading

0 comments on commit d653592

Please sign in to comment.