Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Zeyber committed Jul 19, 2021
2 parents 4bfbe50 + 7650c1c commit 5038041
Show file tree
Hide file tree
Showing 2,201 changed files with 39,155 additions and 42,475 deletions.
2 changes: 1 addition & 1 deletion .env-cmdrc
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"CX_BASE_URL": "https://api.cpce-teamtiger1-d1-public.model-t.cc.commerce.ondemand.com",
"CX_B2B": "true",
"CX_CPQ": "true"
},
},
"b2c": {
"CX_B2B": "false"
},
Expand Down
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/epic_release.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,5 @@ If the new feature requires new or updated sample data for a specific Commerce b
- [ ] New sample data has been loaded and tested in our CI server

## Documentation

- [ ] Documentation input is provided for it to be published on the doc site.
20 changes: 14 additions & 6 deletions .github/ISSUE_TEMPLATE/new-release.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,14 @@ assignees: ''

---

## General steps
## Steps before the release

- [ ] Validate that all merged tickets were tested (QA column must be empty, except for tickets marked as `not-blocking-release`)
- [ ] Create new maintenance branch (`release/*.*.x`) if it doesn't exist yet
- [ ] Announce new maintenance branch (Set topic in tribe channel)
- [ ] Create release branch `release/*.*.*` from the corresponding branch (develop/maintenance)
- [ ] Follow the steps to [release update schematics](https://github.com/SAP/spartacus/blob/develop/projects/schematics/README.md#releasing-update-schematics)
- [ ] Update the maintenance branch on the Hosting service deployment github action (workflows/deploy-hs.yml)
- [ ] Build app on this branch using installation script; prepare the `scripts/install/config.sh` file as below:

```bash
Expand Down Expand Up @@ -43,24 +44,30 @@ assignees: ''
### For Windows

- [ ] Cleanup repo, build and generate compodocs and publish on github pages (`yarn generate:docs` and `yarn publish:docs` for patch stable/releases)
- [ ] Get the spartacussampledata source code zips for both 1905 and 2005 CX versions (use `release/1905/next` and `release/2005/next` branches)
- [ ] Get the spartacussampledata source code zips for all 1905, 2005 and 2011 CX versions (use `release/1905/next`, `release/2005/next` and `release/2011/next` branches)
- [ ] Download and rename in root directory `https://github.tools.sap/cx-commerce/spartacussampledata/archive/release/1905/next.zip` -> `spartacussampledataaddon.1905.zip`
- [ ] Download and rename in root directory `https://github.tools.sap/cx-commerce/spartacussampledata/archive/release/1905/next.tar.gz` -> `spartacussampledataaddon.1905.tar.gz`
- [ ] Download and rename in root directory `https://github.tools.sap/cx-commerce/spartacussampledata/archive/release/2005/next.zip` -> `spartacussampledata.2005.zip`
- [ ] Download and rename in root directory `https://github.tools.sap/cx-commerce/spartacussampledata/archive/release/2005/next.tar.gz` -> `spartacussampledata.2005.tar.gz`
- [ ] Download and rename in root directory `https://github.tools.sap/cx-commerce/spartacussampledata/archive/release/2011/next.zip` -> `spartacussampledata.2011.zip`
- [ ] Download and rename in root directory `https://github.tools.sap/cx-commerce/spartacussampledata/archive/release/2011/next.tar.gz` -> `spartacussampledata.2011.tar.gz`


### For all operative systems

To keep track of spartacussampledata releases, we keep a `latest` branch on each supported version that always points to the latest stable release. Every release, we incorporate the latest changes to them.
Do the following steps to keep track of spartacussampledata releases:

- [ ] Tag sample data branches for each version (1905, 2005):
- [ ] Tag sample data branches for each version (1905, 2005, 2011):
- [ ] `git clone https://github.tools.sap/cx-commerce/spartacussampledata` (if already present `cd spartacussampledata && git fetch origin`)
- [ ] tag the final commit on [release/1905/next](https://github.tools.sap/cx-commerce/spartacussampledata/commits/release/1905/next) branch: `git tag 1905-*.*.* HEAD-COMMIT-HASH-FROM-release/1905/next`
- [ ] tag the final commit on [release/2005/next](https://github.tools.sap/cx-commerce/spartacussampledata/commits/release/2005/next) branch: `git tag 2005-*.*.* HEAD-COMMIT-HASH-FROM-release/2005/next`
- [ ] tag the final commit on [release/2011/next](https://github.tools.sap/cx-commerce/spartacussampledata/commits/release/2011/next) branch: `git tag 2011-*.*.* HEAD-COMMIT-HASH-FROM-release/2011/next`
- [ ] push created tags: `git push origin --tags`

---

## Release specific steps

- [ ] Before you release libraries, fetch all git tags from github with `git fetch origin --tags` (required to generate release notes)
- [ ] Release libraries with release scripts:
- Make sure your GITHUB_TOKEN env variable is set and valid
Expand All @@ -71,22 +78,23 @@ To keep track of spartacussampledata releases, we keep a `latest` branch on each
- [ ] `npm run release:core:with-changelog`
- [ ] `npm run release:storefront:with-changelog`
- [ ] `npm run release:user:with-changelog` (needed since `3.2.0-rc.0`)
- [ ] `npm run release:tracking:with-changelog` (needed since `3.2.0-next.0`)
- [ ] `npm run release:cds:with-changelog`
- [ ] `npm run release:assets:with-changelog`
- [ ] `npm run release:styles:with-changelog`
- [ ] `npm run release:schematics:with-changelog`
- [ ] `npm run release:checkout:with-changelog` (needed since `4.0.0-rc.0`)
- [ ] `npm run release:asm:with-changelog` (needed since `3.2.0-rc.0`)
- [ ] `npm run release:cart:with-changelog` (needed since `3.2.0-rc.0`)
- [ ] `npm run release:setup:with-changelog` (needed since `3.0.0-next.1`)
- [ ] `npm run release:organization:with-changelog` (needed since `3.0.0-next.1`)
- [ ] `npm run release:storefinder:with-changelog` (needed since `3.0.0-rc.0`)
- [ ] `npm run release:tracking:with-changelog` (needed since `3.2.0-next.0`)
- [ ] `npm run release:product:with-changelog` (needed since `3.2.0-next.1`)
- [ ] `npm run release:smartedit:with-changelog` (needed since `3.2.0-next.0`)
- [ ] `npm run release:qualtrics:with-changelog` (needed since `3.1.0-next.0`)
- [ ] `npm run release:product-configurator:with-changelog` (needed since `3.1.0-next.0`)
- [ ] (for <3.2.0 releases set the spartacus peerDependencies manually, then)
`npm run release:cdc:with-changelog` (since 3.2.0 release like any other lib with the same version as everything else. For older versions since 2.1.0-next.0 - publish under `0.<packages-version>.0` eg. `0.201.0-next.0` for first `2.1.0-next.0` release)
- [ ] `npm run release:schematics:with-changelog`

- [ ] Check that the release notes are populated on github (if they are not, update them)
- [ ] Check tags on npm.
Expand Down
4 changes: 2 additions & 2 deletions .github/hs-deploy-action/src/deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ import { addComment, getBundleId } from './functions';
* Deploys an app to the hosting service
* @param github Github object
* @param octoKit Octokit object
* @param branch Name of the branch to deploy
*/
export async function deploy(github: any, octoKit: any) {
export async function deploy(github: any, octoKit: any, branch: string) {
const context = github.context;
const branch = context.payload.pull_request.head.ref;

console.log(`--> Deploying branch ${branch}`);

Expand Down
24 changes: 13 additions & 11 deletions .github/hs-deploy-action/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,27 +11,29 @@ async function run() {
throw new Error('Github token missing in action');
}

const octoKit = github.getOctokit(GITHUB_TOKEN);
const context = github.context;
const pr = context.payload.pull_request;
const eventName = context.eventName;

if (!pr) {
throw new Error(
'Missing pull request context! Make sure to run this action only for pull_requests.'
);
}
let branch;

const branch = pr.head.ref;
const octoKit = github.getOctokit(GITHUB_TOKEN);
if (eventName === 'push') {
branch = context.payload.ref.replace('refs/heads/', '');
} else if (eventName === 'pull_request') {
branch = context.payload.pull_request.head.ref;
}

console.log(`Starting Hosting service deployment of PR branch ${branch}.`);
console.log(
`Starting Hosting service deployment on '${eventName}' of branch '${branch}'`
);

//run sh to get CLI and prep
await exec.exec('sh', ['./.github/hs-deploy-action/upp-cli-setup.sh']);

if (UPP_ACTION === 'deploy') {
await build();
await deploy(github, octoKit);
console.log('--> Hosting service deployment done');
await deploy(github, octoKit, branch);
console.log('--> Hosting service deployment done!');
} else if (UPP_ACTION === 'undeploy') {
await undeploy(branch);
}
Expand Down
10 changes: 9 additions & 1 deletion .github/workflows/deploy-hs.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
on:
pull_request:
types: [opened, synchronize]
branches:
- 'feature/GH-**'
- 'epic/**'
- '!develop'
- '!release/4.0.x'
push:
branches:
- develop
- release/4.0.x
name: Hosting service - Deploy
jobs:
hostingServiceDeploy:
Expand All @@ -24,4 +33,3 @@ jobs:
UPP_TENANT: ${{ secrets.UPP_TENANT}}
UPP_CLIENT: ${{ secrets.UPP_CLIENT}}
UPP_SECRET: ${{ secrets.UPP_SECRET}}

38 changes: 38 additions & 0 deletions .reuse/dep5
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: Spartacus
Upstream-Contact: SAP Spartacus team <[email protected]>
Source: https://github.com/SAP/spartacus
Disclaimer: The code in this project may include calls to APIs (“API Calls”) of
SAP or third-party products or services developed outside of this project
(“External Products”).
“APIs” means application programming interfaces, as well as their respective
specifications and implementing code that allows software to communicate with
other software.
API Calls to External Products are not licensed under the open source license
that governs this project. The use of such API Calls and related External
Products are subject to applicable additional agreements with the relevant
provider of the External Products. In no event shall the open source license
that governs this project grant any rights in or to any External Products,or
alter, expand or supersede any terms of the applicable additional agreements.
If you have a valid license agreement with SAP for the use of a particular SAP
External Product, then you may make use of any API Calls included in this
project’s code for that SAP External Product, subject to the terms of such
license agreement. If you do not have a valid license agreement for the use of
a particular SAP External Product, then you may only make use of any API Calls
in this project for that SAP External Product for your internal, non-productive
and non-commercial test and evaluation of such API Calls. Nothing herein grants
you any rights to use or access any SAP External Product, or provide any third
parties the right to use of access any SAP External Product, through API Calls.


# Spartacus code

Files: *
Copyright: 2018-2021 SAP SE or an SAP affiliate company and Spartacus contributors
License: Apache-2.0

# Sample paragraph, commented out:
#
# Files: src/*
# Copyright: $YEAR $NAME <$CONTACT>
# License: ...
8 changes: 6 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,12 @@ branches:
defaults: &defaults
script: "export CYPRESS_CONFIG=cypress.ci.json && export SPA_ENV='ci,b2c' && ./ci-scripts/e2e-cypress.sh"
jobs:
- script: "./ci-scripts/unit-tests-sonar.sh sonar"
name: "Unit tests / Sonar"
- script: "./ci-scripts/unit-tests-core-lib.sh"
name: "Unit tests for core and storefrontlib"
- script: "./ci-scripts/unit-tests.sh"
name: "Unit tests"
- script: "./ci-scripts/e2e-cypress.sh --ssr"
name: "SSR build / smoke test"
- script: "./ci-scripts/validate-lint.sh"
name: "Validation checks"
- script: "export CYPRESS_CONFIG=cypress.ci.b2b.json && export SPA_ENV='ci,b2b' && ./ci-scripts/e2e-cypress.sh -s b2b"
Expand Down
16 changes: 16 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,22 @@
"args": ["add", "@spartacus/schematics@latest"],
"console": "integratedTerminal",
"outFiles": ["${workspaceFolder}/**/*.js"]
},

// to debug a schematics Jest test, make sure that a spec.ts file is currently opened.
{
"type": "node",
"request": "launch",
"name": "Debug project/schematics Jest test",
"program": "${workspaceFolder}/node_modules/.bin/jest",
"args": [
"${fileBasenameNoExtension}",
"--config",
"projects/schematics/jest.schematics.config.js"
],
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen",
"disableOptimisticBPs": true
}
]
}
56 changes: 28 additions & 28 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,6 @@ We welcome contributions to the Spartacus codebase. Before you start your first

1. You must be aware of the Apache License (which describes contributions), and you must agree to the [Contributors License Agreement](LICENSE.md). This is common practice for most open source projects.

Note: You do not need to sign the CLA until you submit your first pull request. If you have not signed the CLA before, a link to the CLA assistant is provided on the PR status page.

* To make this process as simple as possible, we use the *[CLA assistant](https://cla-assistant.io/)* for individual contributions. CLA assistant is an open source tool that integrates with GitHub very well and enables a one-click-experience for accepting the CLA.
* For company contributors, special rules apply. See the respective section below for details.

1. Contributions must be compliant with the project code style, quality, and standards. We also follow them :-)
Expand All @@ -140,9 +137,13 @@ We welcome contributions to the Spartacus codebase. Before you start your first

### Contributor License Agreement

When you contribute anything to Spartacus (code, documentation, analysis, anything), be aware that your contribution is covered by the same [Apache 2.0 License](http://www.apache.org/licenses/LICENSE-2.0) that is applied to Spartacus itself. In particular, you must agree to the [Individual Contributor License Agreement](https://gist.github.com/CLAassistant/bd1ea8ec8aa0357414e8).
When you contribute anything to Spartacus (code, documentation, analysis, anything), be aware that your contribution is covered by the same [Apache 2.0 License](http://www.apache.org/licenses/LICENSE-2.0) that is applied to Spartacus itself.

This applies to all contributors, including those contributing on behalf of a company.

This applies to all contributors, including those contributing on behalf of a company. If you agree to its content, click on the link posted by the CLA assistant as a comment to the pull request. Click it to check the CLA, then accept it on the following screen if you agree to it. CLA assistant will save this decision for upcoming contributions and will notify you if there is any changes to the CLA in the meantime.
### Developer Certificate of Origin (DCO)

Due to legal reasons, contributors will be asked to accept a DCO when they create the first pull request to this project. This happens in an automated fashion during the submission process. SAP uses [the standard DCO text of the Linux Foundation](https://developercertificate.org/).

#### Company Contributors

Expand All @@ -156,53 +157,52 @@ Submit the form to us through one of the following methods:
* Fax to +49 6227 78-45813
* Mail to:

Industry Standards & Open Source Team
Dietmar-Hopp-Allee 16
69190 Walldorf, Germany
Industry Standards & Open Source Team
Dietmar-Hopp-Allee 16
69190 Walldorf, Germany

### Contribution Content Guidelines

A contribution will be considered for inclusion in Spartacus if it meets the following criteria:
A contribution will be considered for inclusion in Spartacus if it meets the following criteria:

* The contribution fits the overall vision and direction of Spartacus
* The contribution truly improves the storefront
* The contribution follows the applicable guidelines and standards.

The "guidelines and standards" requirement could fill entire books and still lack a 100% clear definition, but rest assured that you will receive feedback if something is not right. That being said, please consult the [Contributor's Guide](https://sap.github.io/spartacus-docs/contributors-guide/).
The "guidelines and standards" requirement could fill entire books and still lack a 100% clear definition, but rest assured that you will receive feedback if something is not right. That being said, please consult the [Contributor's Guide](https://sap.github.io/spartacus-docs/contributors-guide/).

### Contribution Process

1. Make sure the change would be welcome, as described above.
1. Make sure the change would be welcome, as described above.

1. Create a fork of the Spartacus library sources.

1. Create a fork of the Spartacus library sources.
1. Build and run the storefront from the library development workspace.

1. Build and run the storefront from the library development workspace.
For more information, see [Contributor Setup](https://sap.github.io/spartacus-docs/contributor-setup/).

For more information, see [Contributor Setup](https://sap.github.io/spartacus-docs/contributor-setup/).
1. Work on the change in your fork (either on the `develop` branch or on a feature branch).

1. Work on the change in your fork (either on the `develop` branch or on a feature branch).
1. Commit and push your changes using the [squash and merge](https://help.github.com/articles/about-pull-request-merges/) feature in GitHub.

1. Commit and push your changes using the [squash and merge](https://help.github.com/articles/about-pull-request-merges/) feature in GitHub.
You should also use the squash and merge feature when additional changes are required after code review.

You should also use the squash and merge feature when additional changes are required after code review.
1. In the commit message, please follow the conventions described in [Committing Code to Spartacus](https://sap.github.io/spartacus-docs/commit-guidelines/).

1. In the commit message, please follow the conventions described in [Committing Code to Spartacus](https://sap.github.io/spartacus-docs/commit-guidelines/).
By following the guidelines, your work will be accurately captured in the release changelog.

By following the guidelines, your work will be accurately captured in the release changelog.
1. If your change fixes an issue reported in GitHub, add the following line to the commit message:

1. If your change fixes an issue reported in GitHub, add the following line to the commit message:
```Fixes https://github.com/SAP/spartacus/issues/(issueNumber)```

```Fixes https://github.com/SAP/spartacus/issues/(issueNumber)```
* Do not add a colon after "Fixes", as this prevents automatic closing.
* When your pull request number is known (for example, because you enhanced a pull request after a code review), you can also add the following line:

* Do not add a colon after "Fixes", as this prevents automatic closing.
* When your pull request number is known (for example, because you enhanced a pull request after a code review), you can also add the following line:
```Closes https://github.com/SAP/spartacus/pull/(pullRequestNumber)```

```Closes https://github.com/SAP/spartacus/pull/(pullRequestNumber)```
1. Create a pull request so that we can review your change.
1. Wait for our code review and approval, possibly enhancing your change on request.

1. Create a pull request so that we can review your change.
1. Follow the link posted by the CLA assistant to your pull request and accept it, as described above.
1. Wait for our code review and approval, possibly enhancing your change on request.

Note: This may take time, depending on the required effort for reviewing, testing, and clarification. Spartacus developers are also working their regular duties.

1. After the change has been approved, we will inform you in a comment.
Expand Down
Loading

0 comments on commit 5038041

Please sign in to comment.