diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 000000000..75f927072 --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,74 @@ +# Adobe Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, gender identity and expression, level of experience, +nationality, personal appearance, race, religion, or sexual identity and +orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or +advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or +reject comments, commits, code, wiki edits, issues, and other contributions +that are not aligned to this Code of Conduct, or to ban temporarily or +permanently any contributor for other behaviors that they deem inappropriate, +threatening, offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported by contacting the project team at Grp-opensourceoffice@adobe.com. All +complaints will be reviewed and investigated and will result in a response that +is deemed necessary and appropriate to the circumstances. The project team is +obligated to maintain confidentiality with regard to the reporter of an incident. +Further details of specific enforcement policies may be posted separately. + +Project maintainers who do not follow or enforce the Code of Conduct in good +faith may face temporary or permanent repercussions as determined by other +members of the project's leadership. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, +available at [http://contributor-covenant.org/version/1/4][version] + +[homepage]: http://contributor-covenant.org +[version]: http://contributor-covenant.org/version/1/4/ \ No newline at end of file diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 000000000..01bbeac1d --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,74 @@ +# Contributing to Project Franklin + +This project (like almost all of Project Franklin) is an Open Development project and welcomes contributions from everyone who finds it useful or lacking. + +## Code Of Conduct + +This project adheres to the Adobe [code of conduct](CODE_OF_CONDUCT.md). By participating, you are expected to uphold this code. Please report unacceptable behavior to cstaub at adobe dot com. + +## Contributor License Agreement + +All third-party contributions to this project must be accompanied by a signed contributor license. This gives Adobe permission to redistribute your contributions as part of the project. [Sign our CLA](http://opensource.adobe.com/cla.html)! You only need to submit an Adobe CLA one time, so if you have submitted one previously, you are good to go! + +## Things to Keep in Mind + +This project uses a **commit then review** process, which means that for approved maintainers, changes can be merged immediately, but will be reviewed by others. + +For other contributors, a maintainer of the project has to approve the pull request. + +# Before You Contribute + +* Check that there is an existing issue in GitHub issues +* Check if there are other pull requests that might overlap or conflict with your intended contribution + +# How to Contribute + +1. Fork the repository +2. Make some changes on a branch on your fork +3. Create a pull request from your branch + +In your pull request, outline: + +* What the changes intend +* How they change the existing code +* If (and what) they breaks +* Start the pull request with the GitHub issue ID, e.g. #123 + +Lastly, please follow the [pull request template](.github/pull_request_template.md) when submitting a pull request! + +Each commit message that is not part of a pull request: + +* Should contain the issue ID like `#123` +* Can contain the tag `[trivial]` for trivial changes that don't relate to an issue + + + +## Coding Styleguides + +We enforce a coding styleguide using `eslint`. As part of your build, run `npm run lint` to check if your code is conforming to the style guide. We do the same for every PR in our CI, so PRs will get rejected if they don't follow the style guide. + +You can fix some of the issues automatically by running `npx eslint . --fix`. + +## Commit Message Format + +This project uses a structured commit changelog format that should be used for every commit. Use `npm run commit` instead of your usual `git commit` to generate commit messages using a wizard. + +```bash +# either add all changed files +$ git add -A +# or selectively add files +$ git add package.json +# then commit using the wizard +$ npm run commit +``` + +# How Contributions get Reviewed + +One of the maintainers will look at the pull request within one week. Feedback on the pull request will be given in writing, in GitHub. + +# Release Management + +The project's committers will release to the [Adobe organization on npmjs.org](https://www.npmjs.com/org/adobe). +Please contact the [Adobe Open Source Advisory Board](https://git.corp.adobe.com/OpenSourceAdvisoryBoard/discuss/issues) to get access to the npmjs organization. + +The release process is fully automated using `semantic-release`, increasing the version numbers, etc. based on the contents of the commit messages found. diff --git a/package-lock.json b/package-lock.json index b93cb98ed..7bb4e6bfb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12399,7 +12399,7 @@ }, "packages/spacecat-shared-data-access": { "name": "@adobe/spacecat-shared-data-access", - "version": "1.5.1", + "version": "1.5.2", "license": "Apache-2.0", "dependencies": { "@adobe/spacecat-shared-dynamo": "1.2.5", @@ -12928,7 +12928,7 @@ }, "packages/spacecat-shared-dynamo": { "name": "@adobe/spacecat-shared-dynamo", - "version": "1.2.7", + "version": "1.2.8", "license": "Apache-2.0", "dependencies": { "@adobe/spacecat-shared-utils": "1.1.0", diff --git a/packages/spacecat-shared-data-access/CODE_OF_CONDUCT.md b/packages/spacecat-shared-data-access/CODE_OF_CONDUCT.md new file mode 100644 index 000000000..75f927072 --- /dev/null +++ b/packages/spacecat-shared-data-access/CODE_OF_CONDUCT.md @@ -0,0 +1,74 @@ +# Adobe Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, gender identity and expression, level of experience, +nationality, personal appearance, race, religion, or sexual identity and +orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or +advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or +reject comments, commits, code, wiki edits, issues, and other contributions +that are not aligned to this Code of Conduct, or to ban temporarily or +permanently any contributor for other behaviors that they deem inappropriate, +threatening, offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported by contacting the project team at Grp-opensourceoffice@adobe.com. All +complaints will be reviewed and investigated and will result in a response that +is deemed necessary and appropriate to the circumstances. The project team is +obligated to maintain confidentiality with regard to the reporter of an incident. +Further details of specific enforcement policies may be posted separately. + +Project maintainers who do not follow or enforce the Code of Conduct in good +faith may face temporary or permanent repercussions as determined by other +members of the project's leadership. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, +available at [http://contributor-covenant.org/version/1/4][version] + +[homepage]: http://contributor-covenant.org +[version]: http://contributor-covenant.org/version/1/4/ \ No newline at end of file diff --git a/packages/spacecat-shared-data-access/CONTRIBUTING.md b/packages/spacecat-shared-data-access/CONTRIBUTING.md new file mode 100644 index 000000000..01bbeac1d --- /dev/null +++ b/packages/spacecat-shared-data-access/CONTRIBUTING.md @@ -0,0 +1,74 @@ +# Contributing to Project Franklin + +This project (like almost all of Project Franklin) is an Open Development project and welcomes contributions from everyone who finds it useful or lacking. + +## Code Of Conduct + +This project adheres to the Adobe [code of conduct](CODE_OF_CONDUCT.md). By participating, you are expected to uphold this code. Please report unacceptable behavior to cstaub at adobe dot com. + +## Contributor License Agreement + +All third-party contributions to this project must be accompanied by a signed contributor license. This gives Adobe permission to redistribute your contributions as part of the project. [Sign our CLA](http://opensource.adobe.com/cla.html)! You only need to submit an Adobe CLA one time, so if you have submitted one previously, you are good to go! + +## Things to Keep in Mind + +This project uses a **commit then review** process, which means that for approved maintainers, changes can be merged immediately, but will be reviewed by others. + +For other contributors, a maintainer of the project has to approve the pull request. + +# Before You Contribute + +* Check that there is an existing issue in GitHub issues +* Check if there are other pull requests that might overlap or conflict with your intended contribution + +# How to Contribute + +1. Fork the repository +2. Make some changes on a branch on your fork +3. Create a pull request from your branch + +In your pull request, outline: + +* What the changes intend +* How they change the existing code +* If (and what) they breaks +* Start the pull request with the GitHub issue ID, e.g. #123 + +Lastly, please follow the [pull request template](.github/pull_request_template.md) when submitting a pull request! + +Each commit message that is not part of a pull request: + +* Should contain the issue ID like `#123` +* Can contain the tag `[trivial]` for trivial changes that don't relate to an issue + + + +## Coding Styleguides + +We enforce a coding styleguide using `eslint`. As part of your build, run `npm run lint` to check if your code is conforming to the style guide. We do the same for every PR in our CI, so PRs will get rejected if they don't follow the style guide. + +You can fix some of the issues automatically by running `npx eslint . --fix`. + +## Commit Message Format + +This project uses a structured commit changelog format that should be used for every commit. Use `npm run commit` instead of your usual `git commit` to generate commit messages using a wizard. + +```bash +# either add all changed files +$ git add -A +# or selectively add files +$ git add package.json +# then commit using the wizard +$ npm run commit +``` + +# How Contributions get Reviewed + +One of the maintainers will look at the pull request within one week. Feedback on the pull request will be given in writing, in GitHub. + +# Release Management + +The project's committers will release to the [Adobe organization on npmjs.org](https://www.npmjs.com/org/adobe). +Please contact the [Adobe Open Source Advisory Board](https://git.corp.adobe.com/OpenSourceAdvisoryBoard/discuss/issues) to get access to the npmjs organization. + +The release process is fully automated using `semantic-release`, increasing the version numbers, etc. based on the contents of the commit messages found. diff --git a/packages/spacecat-shared-data-access/docs/schema.json b/packages/spacecat-shared-data-access/docs/schema.json index ca54d4953..0b6d638f4 100644 --- a/packages/spacecat-shared-data-access/docs/schema.json +++ b/packages/spacecat-shared-data-access/docs/schema.json @@ -34,6 +34,10 @@ "AttributeName": "isLive", "AttributeType": "B" }, + { + "AttributeName": "deliveryType", + "AttributeType": "S" + }, { "AttributeName": "GSI1PK", "AttributeType": "S" @@ -67,6 +71,22 @@ "Projection": { "ProjectionType": "ALL" } + }, + { + "IndexName": "spacecat-services-all-sites-by-delivery-type", + "KeyAttributes": { + "PartitionKey": { + "AttributeName": "GSI1PK", + "AttributeType": "S" + }, + "SortKey": { + "AttributeName": "deliveryType", + "AttributeType": "S" + } + }, + "Projection": { + "ProjectionType": "ALL" + } } ], "DataAccess": { diff --git a/packages/spacecat-shared-data-access/src/dto/site.js b/packages/spacecat-shared-data-access/src/dto/site.js index 081f48254..008cae0f3 100644 --- a/packages/spacecat-shared-data-access/src/dto/site.js +++ b/packages/spacecat-shared-data-access/src/dto/site.js @@ -25,6 +25,7 @@ export const SiteDto = { toDynamoItem: (site) => ({ id: site.getId(), baseURL: site.getBaseURL(), + deliveryType: site.getDeliveryType(), gitHubURL: site.getGitHubURL() || '', imsOrgId: site.getImsOrgId() || '', isLive: site.isLive(), @@ -43,6 +44,7 @@ export const SiteDto = { const siteData = { id: dynamoItem.id, baseURL: dynamoItem.baseURL, + deliveryType: dynamoItem.deliveryType, gitHubURL: dynamoItem.gitHubURL, imsOrgId: dynamoItem.imsOrgId, isLive: dynamoItem.isLive, diff --git a/packages/spacecat-shared-data-access/src/index.d.ts b/packages/spacecat-shared-data-access/src/index.d.ts index 00cd843e2..ed2f45347 100644 --- a/packages/spacecat-shared-data-access/src/index.d.ts +++ b/packages/spacecat-shared-data-access/src/index.d.ts @@ -41,10 +41,10 @@ export interface Audit { */ getPreviousAuditResult: () => object | null; -/** - * Sets the result of the previous audit. - * @param {object} result The parsed audit result. - */ + /** + * Sets the result of the previous audit. + * @param {object} result The parsed audit result. + */ setPreviousAuditResult: (result: object) => void; /** @@ -137,6 +137,12 @@ export interface Site { */ getBaseURL: () => string; + /** + * Retrieves the delivery type of the site. + * @returns {string} The delivery type. + */ + getDeliveryType: () => string; + /** * Retrieves the GitHub URL associated with the site. * @returns {string} The GitHub URL. @@ -236,6 +242,7 @@ export interface DataAccess { siteId: string, ) => Promise; getSites: () => Promise; + getSitesByDeliveryType: () => Promise; getSitesToAudit: () => Promise; getSitesWithLatestAudit: ( auditType: string, @@ -276,6 +283,7 @@ interface DataAccessConfig { tableNameLatestAudits: string; tableNameSites: string; indexNameAllSites: string; + indexNameAllSitesByDeliveryType: string; indexNameAllLatestAuditScores: string; pkAllSites: string; pkAllLatestAudits: string; diff --git a/packages/spacecat-shared-data-access/src/index.js b/packages/spacecat-shared-data-access/src/index.js index a85a214c1..c75429f96 100644 --- a/packages/spacecat-shared-data-access/src/index.js +++ b/packages/spacecat-shared-data-access/src/index.js @@ -17,6 +17,7 @@ const TABLE_NAME_LATEST_AUDITS = 'spacecat-services-latest-audits-dev'; const TABLE_NAME_SITES = 'spacecat-services-sites-dev'; const INDEX_NAME_ALL_SITES = 'spacecat-services-all-sites-dev'; +const INDEX_NAME_ALL_SITES_BY_DELIVERY_TYPE = 'spacecat-services-all-sites-by-delivery-type-dev'; const INDEX_NAME_ALL_LATEST_AUDIT_SCORES = 'spacecat-services-all-latest-audit-scores-dev'; const PK_ALL_SITES = 'ALL_SITES'; @@ -32,6 +33,7 @@ export default function dataAccessWrapper(fn) { DYNAMO_TABLE_NAME_LATEST_AUDITS = TABLE_NAME_LATEST_AUDITS, DYNAMO_TABLE_NAME_SITES = TABLE_NAME_SITES, DYNAMO_INDEX_NAME_ALL_SITES = INDEX_NAME_ALL_SITES, + DYNAMO_INDEX_NAME_ALL_SITES_BY_DELIVERY_TYPE = INDEX_NAME_ALL_SITES_BY_DELIVERY_TYPE, DYNAMO_INDEX_NAME_ALL_LATEST_AUDIT_SCORES = INDEX_NAME_ALL_LATEST_AUDIT_SCORES, } = context.env; @@ -40,6 +42,7 @@ export default function dataAccessWrapper(fn) { tableNameLatestAudits: DYNAMO_TABLE_NAME_LATEST_AUDITS, tableNameSites: DYNAMO_TABLE_NAME_SITES, indexNameAllSites: DYNAMO_INDEX_NAME_ALL_SITES, + indexNameAllSitesByDeliveryType: DYNAMO_INDEX_NAME_ALL_SITES_BY_DELIVERY_TYPE, indexNameAllLatestAuditScores: DYNAMO_INDEX_NAME_ALL_LATEST_AUDIT_SCORES, pkAllSites: PK_ALL_SITES, pkAllLatestAudits: PK_ALL_LATEST_AUDITS, diff --git a/packages/spacecat-shared-data-access/src/models/site.js b/packages/spacecat-shared-data-access/src/models/site.js index 2faf205d0..4280b5bae 100644 --- a/packages/spacecat-shared-data-access/src/models/site.js +++ b/packages/spacecat-shared-data-access/src/models/site.js @@ -15,6 +15,14 @@ import { hasText, isObject, isValidUrl } from '@adobe/spacecat-shared-utils'; import { Base } from './base.js'; import AuditConfig from './site/audit-config.js'; +export const DELIVERY_TYPES = { + AEM_CS: 'aem_cs', + AEM_EDGE: 'aem_edge', + OTHER: 'other', +}; + +export const DEFAULT_DELIVERY_TYPE = DELIVERY_TYPES.AEM_EDGE; + /** * Creates a new Site. * @@ -27,6 +35,7 @@ const Site = (data = {}) => { self.getAuditConfig = () => self.state.auditConfig; self.getAudits = () => self.state.audits; self.getBaseURL = () => self.state.baseURL; + self.getDeliveryType = () => self.state.deliveryType; self.getGitHubURL = () => self.state.gitHubURL; self.getImsOrgId = () => self.state.imsOrgId; self.isLive = () => self.state.isLive; @@ -80,6 +89,17 @@ const Site = (data = {}) => { return self; }; + self.updateDeliveryType = (deliveryType) => { + if (!Object.values(DELIVERY_TYPES).includes(deliveryType)) { + throw new Error(`Invalid delivery type: ${deliveryType}`); + } + + self.state.deliveryType = deliveryType; + self.touch(); + + return self; + }; + /** * Updates the GitHub URL belonging to the site. * @param {string} gitHubURL - The GitHub URL. @@ -142,6 +162,11 @@ export const createSite = (data) => { throw new Error('Base URL must be a valid URL'); } + newState.deliveryType = newState.deliveryType || DEFAULT_DELIVERY_TYPE; + if (!Object.values(DELIVERY_TYPES).includes(newState.deliveryType)) { + throw new Error(`Invalid delivery type: ${newState.deliveryType}`); + } + if (!Object.prototype.hasOwnProperty.call(newState, 'isLive')) { newState.isLive = false; } diff --git a/packages/spacecat-shared-data-access/src/service/sites/accessPatterns.js b/packages/spacecat-shared-data-access/src/service/sites/accessPatterns.js index 42844bc5c..6e4beecfb 100644 --- a/packages/spacecat-shared-data-access/src/service/sites/accessPatterns.js +++ b/packages/spacecat-shared-data-access/src/service/sites/accessPatterns.js @@ -41,6 +41,28 @@ export const getSites = async (dynamoClient, config) => { return dynamoItems.map((dynamoItem) => SiteDto.fromDynamoItem(dynamoItem)); }; +/** + * Retrieves all sites of a specific delivery type. + * @param {DynamoDbClient} dynamoClient - The DynamoDB client. + * @param {DataAccessConfig} config - The data access config. + * @param {string} deliveryType - The delivery type. + * @return {Promise[]>} A promise that resolves to an array of all sites of the + * specified delivery type. + */ +export const getSitesByDeliveryType = async (dynamoClient, config, deliveryType) => { + const dynamoItems = await dynamoClient.query({ + TableName: config.tableNameSites, + IndexName: config.indexNameAllSitesByDeliveryType, + KeyConditionExpression: 'GSI1PK = :gsi1pk AND deliveryType = :deliveryType', + ExpressionAttributeValues: { + ':gsi1pk': config.pkAllSites, + ':deliveryType': deliveryType, + }, + }); + + return dynamoItems.map((dynamoItem) => SiteDto.fromDynamoItem(dynamoItem)); +}; + /** * Retrieves a list of site IDs of all sites. * diff --git a/packages/spacecat-shared-data-access/src/service/sites/index.js b/packages/spacecat-shared-data-access/src/service/sites/index.js index d1f6a9983..bb859dc6c 100644 --- a/packages/spacecat-shared-data-access/src/service/sites/index.js +++ b/packages/spacecat-shared-data-access/src/service/sites/index.js @@ -17,7 +17,7 @@ import { getSiteByBaseURLWithAudits, getSiteByBaseURLWithLatestAudit, getSiteByID, - getSites, + getSites, getSitesByDeliveryType, getSitesToAudit, getSitesWithLatestAudit, removeSite, updateSite, @@ -28,6 +28,11 @@ export const siteFunctions = (dynamoClient, config, log) => ({ dynamoClient, config, ), + getSitesByDeliveryType: (deliveryType) => getSitesByDeliveryType( + dynamoClient, + config, + deliveryType, + ), getSitesToAudit: () => getSitesToAudit( dynamoClient, config, diff --git a/packages/spacecat-shared-data-access/test/it/db.test.js b/packages/spacecat-shared-data-access/test/it/db.test.js index 9804fd4a5..0e8c2885b 100644 --- a/packages/spacecat-shared-data-access/test/it/db.test.js +++ b/packages/spacecat-shared-data-access/test/it/db.test.js @@ -30,6 +30,7 @@ function checkSite(site) { expect(site).to.be.an('object'); expect(site.getId()).to.be.a('string'); expect(site.getBaseURL()).to.be.a('string'); + expect(site.getDeliveryType()).to.be.a('string'); expect(site.getGitHubURL()).to.be.a('string'); expect(site.getImsOrgId()).to.be.a('string'); expect(isIsoDate(site.getCreatedAt())).to.be.true; @@ -65,6 +66,7 @@ const TEST_DA_CONFIG = { tableNameLatestAudits: 'spacecat-services-latest-audits', tableNameSites: 'spacecat-services-sites', indexNameAllSites: 'spacecat-services-all-sites', + indexNameAllSitesByDeliveryType: 'spacecat-services-all-sites-by-delivery-type', indexNameAllLatestAuditScores: 'spacecat-services-all-latest-audit-scores', pkAllSites: 'ALL_SITES', pkAllLatestAudits: 'ALL_LATEST_AUDITS', @@ -109,6 +111,17 @@ describe('DynamoDB Integration Test', async () => { }); }); + it('gets sites by delivery type', async () => { + const sites = await dataAccess.getSitesByDeliveryType('aem_cs'); + + expect(sites.length).to.equal(NUMBER_OF_SITES / 2); + + sites.forEach((site) => { + checkSite(site); + expect(site.getAudits()).to.be.an('array').that.has.lengthOf(0); + }); + }); + it('gets sites to audit', async () => { const sites = await dataAccess.getSitesToAudit(); @@ -188,17 +201,20 @@ describe('DynamoDB Integration Test', async () => { it('updates an existing site', async () => { const siteToUpdate = await dataAccess.getSiteByBaseURL('https://example1.com'); const originalUpdatedAt = siteToUpdate.getUpdatedAt(); + const newDeliveryType = 'aem_cs'; const newGitHubURL = 'https://github.com/newOrg/some-repo'; const newImsOrgId = 'updatedOrg123'; await sleep(10); // Make sure updatedAt is different + siteToUpdate.updateDeliveryType(newDeliveryType); siteToUpdate.updateGitHubURL(newGitHubURL); siteToUpdate.updateImsOrgId(newImsOrgId); siteToUpdate.toggleLive(); const updatedSite = await dataAccess.updateSite(siteToUpdate); + expect(updatedSite.getDeliveryType()).to.equal(newDeliveryType); expect(updatedSite.getGitHubURL()).to.equal(newGitHubURL); expect(updatedSite.getImsOrgId()).to.equal(newImsOrgId); expect(updatedSite.isLive()).to.be.false; diff --git a/packages/spacecat-shared-data-access/test/it/generateSampleData.js b/packages/spacecat-shared-data-access/test/it/generateSampleData.js index a477d84bf..cc3265098 100644 --- a/packages/spacecat-shared-data-access/test/it/generateSampleData.js +++ b/packages/spacecat-shared-data-access/test/it/generateSampleData.js @@ -163,6 +163,7 @@ export default async function generateSampleData( sites.push({ id: siteId, baseURL: `https://example${i}.com`, + deliveryType: i % 2 === 0 ? 'aem_edge' : 'aem_cs', gitHubURL: `https://github.com/org-${i}/test-repo`, imsOrgId: `${i}-1234@AdobeOrg`, isLive: true, diff --git a/packages/spacecat-shared-data-access/test/unit/models/site.test.js b/packages/spacecat-shared-data-access/test/unit/models/site.test.js index de6922417..9aea9a94f 100644 --- a/packages/spacecat-shared-data-access/test/unit/models/site.test.js +++ b/packages/spacecat-shared-data-access/test/unit/models/site.test.js @@ -18,6 +18,7 @@ import { sleep } from '../util.js'; const validData = { baseURL: 'https://www.example.com', + deliveryType: 'aem_edge', imsOrgId: 'org123', auditConfig: { auditsDisabled: false, @@ -34,6 +35,10 @@ describe('Site Model Tests', () => { expect(() => createSite({ ...validData, baseURL: 'invalid-url' })).to.throw('Base URL must be a valid URL'); }); + it('throws an error if deliveryType is invalid', () => { + expect(() => createSite({ ...validData, deliveryType: 'invalid' })).to.throw('Invalid delivery type: invalid'); + }); + it('creates a site object with valid baseURL', () => { const site = createSite({ ...validData }); expect(site).to.be.an('object'); @@ -88,6 +93,12 @@ describe('Site Model Tests', () => { }); */ + it('updates deliveryType correctly', () => { + const newDeliveryType = 'aem_cs'; + site.updateDeliveryType(newDeliveryType); + expect(site.getDeliveryType()).to.equal(newDeliveryType); + }); + it('updates imsOrgId correctly', () => { const newImsOrgId = 'newOrg123'; site.updateImsOrgId(newImsOrgId); @@ -100,6 +111,10 @@ describe('Site Model Tests', () => { expect(site.getGitHubURL()).to.equal(newGitHubURL); }); + it('throws an error when updating with an invalid deliveryType', () => { + expect(() => site.updateDeliveryType('invalid')).to.throw('Invalid delivery type: invalid'); + }); + it('throws an error when updating with an empty imsOrgId', () => { expect(() => site.updateImsOrgId('')).to.throw('IMS Org ID must be provided'); }); diff --git a/packages/spacecat-shared-data-access/test/unit/service/index.test.js b/packages/spacecat-shared-data-access/test/unit/service/index.test.js index af9d8e806..5ada6e192 100644 --- a/packages/spacecat-shared-data-access/test/unit/service/index.test.js +++ b/packages/spacecat-shared-data-access/test/unit/service/index.test.js @@ -30,6 +30,7 @@ describe('Data Access Object Tests', () => { 'updateSite', 'removeSite', 'getSites', + 'getSitesByDeliveryType', 'getSitesToAudit', 'getSitesWithLatestAudit', 'getSiteByBaseURL', diff --git a/packages/spacecat-shared-data-access/test/unit/service/sites/index.test.js b/packages/spacecat-shared-data-access/test/unit/service/sites/index.test.js index 275df6015..1a61626b5 100644 --- a/packages/spacecat-shared-data-access/test/unit/service/sites/index.test.js +++ b/packages/spacecat-shared-data-access/test/unit/service/sites/index.test.js @@ -28,6 +28,7 @@ const TEST_DA_CONFIG = { tableNameLatestAudits: 'test-latest-audits', tableNameSites: 'test-sites', indexNameAllSites: 'test-index-all-sites', + indexNameAllSitesByDeliveryType: 'test-index-all-sites-by-delivery-type', indexNameAllLatestAuditScores: 'test-index-all-latest-audit-scores', pkAllSites: 'test-pk-all-sites', pkAllLatestAudits: 'test-pk-all-latest-audits', @@ -45,6 +46,11 @@ describe('Site Access Pattern Tests', () => { expect(exportedFunctions.getSites).to.be.a('function'); }); + it('exports getSitesByDeliveryType function', () => { + expect(exportedFunctions).to.have.property('getSitesByDeliveryType'); + expect(exportedFunctions.getSitesByDeliveryType).to.be.a('function'); + }); + it('exports getSitesToAudit function', () => { expect(exportedFunctions).to.have.property('getSitesToAudit'); expect(exportedFunctions.getSitesToAudit).to.be.a('function'); @@ -97,6 +103,12 @@ describe('Site Access Pattern Tests', () => { expect(mockDynamoClient.query.called).to.be.true; }); + it('calls getSitesByDeliveryType and returns an array', async () => { + const result = await exportedFunctions.getSitesByDeliveryType('aem_edge'); + expect(result).to.be.an('array'); + expect(mockDynamoClient.query.called).to.be.true; + }); + it('calls getSitesToAudit and returns an array', async () => { const result = await exportedFunctions.getSitesToAudit(); expect(result).to.be.an('array'); diff --git a/packages/spacecat-shared-dynamo/CODE_OF_CONDUCT.md b/packages/spacecat-shared-dynamo/CODE_OF_CONDUCT.md new file mode 100644 index 000000000..75f927072 --- /dev/null +++ b/packages/spacecat-shared-dynamo/CODE_OF_CONDUCT.md @@ -0,0 +1,74 @@ +# Adobe Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, gender identity and expression, level of experience, +nationality, personal appearance, race, religion, or sexual identity and +orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or +advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or +reject comments, commits, code, wiki edits, issues, and other contributions +that are not aligned to this Code of Conduct, or to ban temporarily or +permanently any contributor for other behaviors that they deem inappropriate, +threatening, offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported by contacting the project team at Grp-opensourceoffice@adobe.com. All +complaints will be reviewed and investigated and will result in a response that +is deemed necessary and appropriate to the circumstances. The project team is +obligated to maintain confidentiality with regard to the reporter of an incident. +Further details of specific enforcement policies may be posted separately. + +Project maintainers who do not follow or enforce the Code of Conduct in good +faith may face temporary or permanent repercussions as determined by other +members of the project's leadership. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, +available at [http://contributor-covenant.org/version/1/4][version] + +[homepage]: http://contributor-covenant.org +[version]: http://contributor-covenant.org/version/1/4/ \ No newline at end of file diff --git a/packages/spacecat-shared-dynamo/CONTRIBUTING.md b/packages/spacecat-shared-dynamo/CONTRIBUTING.md new file mode 100644 index 000000000..01bbeac1d --- /dev/null +++ b/packages/spacecat-shared-dynamo/CONTRIBUTING.md @@ -0,0 +1,74 @@ +# Contributing to Project Franklin + +This project (like almost all of Project Franklin) is an Open Development project and welcomes contributions from everyone who finds it useful or lacking. + +## Code Of Conduct + +This project adheres to the Adobe [code of conduct](CODE_OF_CONDUCT.md). By participating, you are expected to uphold this code. Please report unacceptable behavior to cstaub at adobe dot com. + +## Contributor License Agreement + +All third-party contributions to this project must be accompanied by a signed contributor license. This gives Adobe permission to redistribute your contributions as part of the project. [Sign our CLA](http://opensource.adobe.com/cla.html)! You only need to submit an Adobe CLA one time, so if you have submitted one previously, you are good to go! + +## Things to Keep in Mind + +This project uses a **commit then review** process, which means that for approved maintainers, changes can be merged immediately, but will be reviewed by others. + +For other contributors, a maintainer of the project has to approve the pull request. + +# Before You Contribute + +* Check that there is an existing issue in GitHub issues +* Check if there are other pull requests that might overlap or conflict with your intended contribution + +# How to Contribute + +1. Fork the repository +2. Make some changes on a branch on your fork +3. Create a pull request from your branch + +In your pull request, outline: + +* What the changes intend +* How they change the existing code +* If (and what) they breaks +* Start the pull request with the GitHub issue ID, e.g. #123 + +Lastly, please follow the [pull request template](.github/pull_request_template.md) when submitting a pull request! + +Each commit message that is not part of a pull request: + +* Should contain the issue ID like `#123` +* Can contain the tag `[trivial]` for trivial changes that don't relate to an issue + + + +## Coding Styleguides + +We enforce a coding styleguide using `eslint`. As part of your build, run `npm run lint` to check if your code is conforming to the style guide. We do the same for every PR in our CI, so PRs will get rejected if they don't follow the style guide. + +You can fix some of the issues automatically by running `npx eslint . --fix`. + +## Commit Message Format + +This project uses a structured commit changelog format that should be used for every commit. Use `npm run commit` instead of your usual `git commit` to generate commit messages using a wizard. + +```bash +# either add all changed files +$ git add -A +# or selectively add files +$ git add package.json +# then commit using the wizard +$ npm run commit +``` + +# How Contributions get Reviewed + +One of the maintainers will look at the pull request within one week. Feedback on the pull request will be given in writing, in GitHub. + +# Release Management + +The project's committers will release to the [Adobe organization on npmjs.org](https://www.npmjs.com/org/adobe). +Please contact the [Adobe Open Source Advisory Board](https://git.corp.adobe.com/OpenSourceAdvisoryBoard/discuss/issues) to get access to the npmjs organization. + +The release process is fully automated using `semantic-release`, increasing the version numbers, etc. based on the contents of the commit messages found. diff --git a/packages/spacecat-shared-example/CODE_OF_CONDUCT.md b/packages/spacecat-shared-example/CODE_OF_CONDUCT.md new file mode 100644 index 000000000..75f927072 --- /dev/null +++ b/packages/spacecat-shared-example/CODE_OF_CONDUCT.md @@ -0,0 +1,74 @@ +# Adobe Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, gender identity and expression, level of experience, +nationality, personal appearance, race, religion, or sexual identity and +orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or +advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or +reject comments, commits, code, wiki edits, issues, and other contributions +that are not aligned to this Code of Conduct, or to ban temporarily or +permanently any contributor for other behaviors that they deem inappropriate, +threatening, offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported by contacting the project team at Grp-opensourceoffice@adobe.com. All +complaints will be reviewed and investigated and will result in a response that +is deemed necessary and appropriate to the circumstances. The project team is +obligated to maintain confidentiality with regard to the reporter of an incident. +Further details of specific enforcement policies may be posted separately. + +Project maintainers who do not follow or enforce the Code of Conduct in good +faith may face temporary or permanent repercussions as determined by other +members of the project's leadership. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, +available at [http://contributor-covenant.org/version/1/4][version] + +[homepage]: http://contributor-covenant.org +[version]: http://contributor-covenant.org/version/1/4/ \ No newline at end of file diff --git a/packages/spacecat-shared-example/CONTRIBUTING.md b/packages/spacecat-shared-example/CONTRIBUTING.md new file mode 100644 index 000000000..01bbeac1d --- /dev/null +++ b/packages/spacecat-shared-example/CONTRIBUTING.md @@ -0,0 +1,74 @@ +# Contributing to Project Franklin + +This project (like almost all of Project Franklin) is an Open Development project and welcomes contributions from everyone who finds it useful or lacking. + +## Code Of Conduct + +This project adheres to the Adobe [code of conduct](CODE_OF_CONDUCT.md). By participating, you are expected to uphold this code. Please report unacceptable behavior to cstaub at adobe dot com. + +## Contributor License Agreement + +All third-party contributions to this project must be accompanied by a signed contributor license. This gives Adobe permission to redistribute your contributions as part of the project. [Sign our CLA](http://opensource.adobe.com/cla.html)! You only need to submit an Adobe CLA one time, so if you have submitted one previously, you are good to go! + +## Things to Keep in Mind + +This project uses a **commit then review** process, which means that for approved maintainers, changes can be merged immediately, but will be reviewed by others. + +For other contributors, a maintainer of the project has to approve the pull request. + +# Before You Contribute + +* Check that there is an existing issue in GitHub issues +* Check if there are other pull requests that might overlap or conflict with your intended contribution + +# How to Contribute + +1. Fork the repository +2. Make some changes on a branch on your fork +3. Create a pull request from your branch + +In your pull request, outline: + +* What the changes intend +* How they change the existing code +* If (and what) they breaks +* Start the pull request with the GitHub issue ID, e.g. #123 + +Lastly, please follow the [pull request template](.github/pull_request_template.md) when submitting a pull request! + +Each commit message that is not part of a pull request: + +* Should contain the issue ID like `#123` +* Can contain the tag `[trivial]` for trivial changes that don't relate to an issue + + + +## Coding Styleguides + +We enforce a coding styleguide using `eslint`. As part of your build, run `npm run lint` to check if your code is conforming to the style guide. We do the same for every PR in our CI, so PRs will get rejected if they don't follow the style guide. + +You can fix some of the issues automatically by running `npx eslint . --fix`. + +## Commit Message Format + +This project uses a structured commit changelog format that should be used for every commit. Use `npm run commit` instead of your usual `git commit` to generate commit messages using a wizard. + +```bash +# either add all changed files +$ git add -A +# or selectively add files +$ git add package.json +# then commit using the wizard +$ npm run commit +``` + +# How Contributions get Reviewed + +One of the maintainers will look at the pull request within one week. Feedback on the pull request will be given in writing, in GitHub. + +# Release Management + +The project's committers will release to the [Adobe organization on npmjs.org](https://www.npmjs.com/org/adobe). +Please contact the [Adobe Open Source Advisory Board](https://git.corp.adobe.com/OpenSourceAdvisoryBoard/discuss/issues) to get access to the npmjs organization. + +The release process is fully automated using `semantic-release`, increasing the version numbers, etc. based on the contents of the commit messages found. diff --git a/packages/spacecat-shared-http-utils/CODE_OF_CONDUCT.md b/packages/spacecat-shared-http-utils/CODE_OF_CONDUCT.md new file mode 100644 index 000000000..75f927072 --- /dev/null +++ b/packages/spacecat-shared-http-utils/CODE_OF_CONDUCT.md @@ -0,0 +1,74 @@ +# Adobe Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, gender identity and expression, level of experience, +nationality, personal appearance, race, religion, or sexual identity and +orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or +advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or +reject comments, commits, code, wiki edits, issues, and other contributions +that are not aligned to this Code of Conduct, or to ban temporarily or +permanently any contributor for other behaviors that they deem inappropriate, +threatening, offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported by contacting the project team at Grp-opensourceoffice@adobe.com. All +complaints will be reviewed and investigated and will result in a response that +is deemed necessary and appropriate to the circumstances. The project team is +obligated to maintain confidentiality with regard to the reporter of an incident. +Further details of specific enforcement policies may be posted separately. + +Project maintainers who do not follow or enforce the Code of Conduct in good +faith may face temporary or permanent repercussions as determined by other +members of the project's leadership. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, +available at [http://contributor-covenant.org/version/1/4][version] + +[homepage]: http://contributor-covenant.org +[version]: http://contributor-covenant.org/version/1/4/ \ No newline at end of file diff --git a/packages/spacecat-shared-http-utils/CONTRIBUTING.md b/packages/spacecat-shared-http-utils/CONTRIBUTING.md new file mode 100644 index 000000000..01bbeac1d --- /dev/null +++ b/packages/spacecat-shared-http-utils/CONTRIBUTING.md @@ -0,0 +1,74 @@ +# Contributing to Project Franklin + +This project (like almost all of Project Franklin) is an Open Development project and welcomes contributions from everyone who finds it useful or lacking. + +## Code Of Conduct + +This project adheres to the Adobe [code of conduct](CODE_OF_CONDUCT.md). By participating, you are expected to uphold this code. Please report unacceptable behavior to cstaub at adobe dot com. + +## Contributor License Agreement + +All third-party contributions to this project must be accompanied by a signed contributor license. This gives Adobe permission to redistribute your contributions as part of the project. [Sign our CLA](http://opensource.adobe.com/cla.html)! You only need to submit an Adobe CLA one time, so if you have submitted one previously, you are good to go! + +## Things to Keep in Mind + +This project uses a **commit then review** process, which means that for approved maintainers, changes can be merged immediately, but will be reviewed by others. + +For other contributors, a maintainer of the project has to approve the pull request. + +# Before You Contribute + +* Check that there is an existing issue in GitHub issues +* Check if there are other pull requests that might overlap or conflict with your intended contribution + +# How to Contribute + +1. Fork the repository +2. Make some changes on a branch on your fork +3. Create a pull request from your branch + +In your pull request, outline: + +* What the changes intend +* How they change the existing code +* If (and what) they breaks +* Start the pull request with the GitHub issue ID, e.g. #123 + +Lastly, please follow the [pull request template](.github/pull_request_template.md) when submitting a pull request! + +Each commit message that is not part of a pull request: + +* Should contain the issue ID like `#123` +* Can contain the tag `[trivial]` for trivial changes that don't relate to an issue + + + +## Coding Styleguides + +We enforce a coding styleguide using `eslint`. As part of your build, run `npm run lint` to check if your code is conforming to the style guide. We do the same for every PR in our CI, so PRs will get rejected if they don't follow the style guide. + +You can fix some of the issues automatically by running `npx eslint . --fix`. + +## Commit Message Format + +This project uses a structured commit changelog format that should be used for every commit. Use `npm run commit` instead of your usual `git commit` to generate commit messages using a wizard. + +```bash +# either add all changed files +$ git add -A +# or selectively add files +$ git add package.json +# then commit using the wizard +$ npm run commit +``` + +# How Contributions get Reviewed + +One of the maintainers will look at the pull request within one week. Feedback on the pull request will be given in writing, in GitHub. + +# Release Management + +The project's committers will release to the [Adobe organization on npmjs.org](https://www.npmjs.com/org/adobe). +Please contact the [Adobe Open Source Advisory Board](https://git.corp.adobe.com/OpenSourceAdvisoryBoard/discuss/issues) to get access to the npmjs organization. + +The release process is fully automated using `semantic-release`, increasing the version numbers, etc. based on the contents of the commit messages found. diff --git a/packages/spacecat-shared-rum-api-client/CODE_OF_CONDUCT.md b/packages/spacecat-shared-rum-api-client/CODE_OF_CONDUCT.md new file mode 100644 index 000000000..75f927072 --- /dev/null +++ b/packages/spacecat-shared-rum-api-client/CODE_OF_CONDUCT.md @@ -0,0 +1,74 @@ +# Adobe Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, gender identity and expression, level of experience, +nationality, personal appearance, race, religion, or sexual identity and +orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or +advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or +reject comments, commits, code, wiki edits, issues, and other contributions +that are not aligned to this Code of Conduct, or to ban temporarily or +permanently any contributor for other behaviors that they deem inappropriate, +threatening, offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported by contacting the project team at Grp-opensourceoffice@adobe.com. All +complaints will be reviewed and investigated and will result in a response that +is deemed necessary and appropriate to the circumstances. The project team is +obligated to maintain confidentiality with regard to the reporter of an incident. +Further details of specific enforcement policies may be posted separately. + +Project maintainers who do not follow or enforce the Code of Conduct in good +faith may face temporary or permanent repercussions as determined by other +members of the project's leadership. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, +available at [http://contributor-covenant.org/version/1/4][version] + +[homepage]: http://contributor-covenant.org +[version]: http://contributor-covenant.org/version/1/4/ \ No newline at end of file diff --git a/packages/spacecat-shared-rum-api-client/CONTRIBUTING.md b/packages/spacecat-shared-rum-api-client/CONTRIBUTING.md new file mode 100644 index 000000000..01bbeac1d --- /dev/null +++ b/packages/spacecat-shared-rum-api-client/CONTRIBUTING.md @@ -0,0 +1,74 @@ +# Contributing to Project Franklin + +This project (like almost all of Project Franklin) is an Open Development project and welcomes contributions from everyone who finds it useful or lacking. + +## Code Of Conduct + +This project adheres to the Adobe [code of conduct](CODE_OF_CONDUCT.md). By participating, you are expected to uphold this code. Please report unacceptable behavior to cstaub at adobe dot com. + +## Contributor License Agreement + +All third-party contributions to this project must be accompanied by a signed contributor license. This gives Adobe permission to redistribute your contributions as part of the project. [Sign our CLA](http://opensource.adobe.com/cla.html)! You only need to submit an Adobe CLA one time, so if you have submitted one previously, you are good to go! + +## Things to Keep in Mind + +This project uses a **commit then review** process, which means that for approved maintainers, changes can be merged immediately, but will be reviewed by others. + +For other contributors, a maintainer of the project has to approve the pull request. + +# Before You Contribute + +* Check that there is an existing issue in GitHub issues +* Check if there are other pull requests that might overlap or conflict with your intended contribution + +# How to Contribute + +1. Fork the repository +2. Make some changes on a branch on your fork +3. Create a pull request from your branch + +In your pull request, outline: + +* What the changes intend +* How they change the existing code +* If (and what) they breaks +* Start the pull request with the GitHub issue ID, e.g. #123 + +Lastly, please follow the [pull request template](.github/pull_request_template.md) when submitting a pull request! + +Each commit message that is not part of a pull request: + +* Should contain the issue ID like `#123` +* Can contain the tag `[trivial]` for trivial changes that don't relate to an issue + + + +## Coding Styleguides + +We enforce a coding styleguide using `eslint`. As part of your build, run `npm run lint` to check if your code is conforming to the style guide. We do the same for every PR in our CI, so PRs will get rejected if they don't follow the style guide. + +You can fix some of the issues automatically by running `npx eslint . --fix`. + +## Commit Message Format + +This project uses a structured commit changelog format that should be used for every commit. Use `npm run commit` instead of your usual `git commit` to generate commit messages using a wizard. + +```bash +# either add all changed files +$ git add -A +# or selectively add files +$ git add package.json +# then commit using the wizard +$ npm run commit +``` + +# How Contributions get Reviewed + +One of the maintainers will look at the pull request within one week. Feedback on the pull request will be given in writing, in GitHub. + +# Release Management + +The project's committers will release to the [Adobe organization on npmjs.org](https://www.npmjs.com/org/adobe). +Please contact the [Adobe Open Source Advisory Board](https://git.corp.adobe.com/OpenSourceAdvisoryBoard/discuss/issues) to get access to the npmjs organization. + +The release process is fully automated using `semantic-release`, increasing the version numbers, etc. based on the contents of the commit messages found. diff --git a/packages/spacecat-shared-utils/CODE_OF_CONDUCT.md b/packages/spacecat-shared-utils/CODE_OF_CONDUCT.md new file mode 100644 index 000000000..75f927072 --- /dev/null +++ b/packages/spacecat-shared-utils/CODE_OF_CONDUCT.md @@ -0,0 +1,74 @@ +# Adobe Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, gender identity and expression, level of experience, +nationality, personal appearance, race, religion, or sexual identity and +orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or +advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or +reject comments, commits, code, wiki edits, issues, and other contributions +that are not aligned to this Code of Conduct, or to ban temporarily or +permanently any contributor for other behaviors that they deem inappropriate, +threatening, offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported by contacting the project team at Grp-opensourceoffice@adobe.com. All +complaints will be reviewed and investigated and will result in a response that +is deemed necessary and appropriate to the circumstances. The project team is +obligated to maintain confidentiality with regard to the reporter of an incident. +Further details of specific enforcement policies may be posted separately. + +Project maintainers who do not follow or enforce the Code of Conduct in good +faith may face temporary or permanent repercussions as determined by other +members of the project's leadership. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, +available at [http://contributor-covenant.org/version/1/4][version] + +[homepage]: http://contributor-covenant.org +[version]: http://contributor-covenant.org/version/1/4/ \ No newline at end of file diff --git a/packages/spacecat-shared-utils/CONTRIBUTING.md b/packages/spacecat-shared-utils/CONTRIBUTING.md new file mode 100644 index 000000000..01bbeac1d --- /dev/null +++ b/packages/spacecat-shared-utils/CONTRIBUTING.md @@ -0,0 +1,74 @@ +# Contributing to Project Franklin + +This project (like almost all of Project Franklin) is an Open Development project and welcomes contributions from everyone who finds it useful or lacking. + +## Code Of Conduct + +This project adheres to the Adobe [code of conduct](CODE_OF_CONDUCT.md). By participating, you are expected to uphold this code. Please report unacceptable behavior to cstaub at adobe dot com. + +## Contributor License Agreement + +All third-party contributions to this project must be accompanied by a signed contributor license. This gives Adobe permission to redistribute your contributions as part of the project. [Sign our CLA](http://opensource.adobe.com/cla.html)! You only need to submit an Adobe CLA one time, so if you have submitted one previously, you are good to go! + +## Things to Keep in Mind + +This project uses a **commit then review** process, which means that for approved maintainers, changes can be merged immediately, but will be reviewed by others. + +For other contributors, a maintainer of the project has to approve the pull request. + +# Before You Contribute + +* Check that there is an existing issue in GitHub issues +* Check if there are other pull requests that might overlap or conflict with your intended contribution + +# How to Contribute + +1. Fork the repository +2. Make some changes on a branch on your fork +3. Create a pull request from your branch + +In your pull request, outline: + +* What the changes intend +* How they change the existing code +* If (and what) they breaks +* Start the pull request with the GitHub issue ID, e.g. #123 + +Lastly, please follow the [pull request template](.github/pull_request_template.md) when submitting a pull request! + +Each commit message that is not part of a pull request: + +* Should contain the issue ID like `#123` +* Can contain the tag `[trivial]` for trivial changes that don't relate to an issue + + + +## Coding Styleguides + +We enforce a coding styleguide using `eslint`. As part of your build, run `npm run lint` to check if your code is conforming to the style guide. We do the same for every PR in our CI, so PRs will get rejected if they don't follow the style guide. + +You can fix some of the issues automatically by running `npx eslint . --fix`. + +## Commit Message Format + +This project uses a structured commit changelog format that should be used for every commit. Use `npm run commit` instead of your usual `git commit` to generate commit messages using a wizard. + +```bash +# either add all changed files +$ git add -A +# or selectively add files +$ git add package.json +# then commit using the wizard +$ npm run commit +``` + +# How Contributions get Reviewed + +One of the maintainers will look at the pull request within one week. Feedback on the pull request will be given in writing, in GitHub. + +# Release Management + +The project's committers will release to the [Adobe organization on npmjs.org](https://www.npmjs.com/org/adobe). +Please contact the [Adobe Open Source Advisory Board](https://git.corp.adobe.com/OpenSourceAdvisoryBoard/discuss/issues) to get access to the npmjs organization. + +The release process is fully automated using `semantic-release`, increasing the version numbers, etc. based on the contents of the commit messages found.