Skip to content

Commit

Permalink
Merge pull request #277 from open-sauced/beta
Browse files Browse the repository at this point in the history
main <- v1.14.1-beta.6
  • Loading branch information
bdougie authored Nov 1, 2023
2 parents 2f8617f + 30f492c commit abffdf3
Show file tree
Hide file tree
Showing 26 changed files with 276 additions and 65 deletions.
2 changes: 1 addition & 1 deletion .env.development
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
VITE_OPEN_SAUCED_INSIGHTS_DOMAIN = "beta.insights.opensauced.pizza"
VITE_OPEN_SAUCED_INSIGHTS_DOMAIN = "beta.app.opensauced.pizza"
VITE_OPEN_SAUCED_API_ENDPOINT = "https://beta.api.opensauced.pizza/v1"
VITE_OPEN_SAUCED_SUPABASE_ID = "fcqqkxwlntnrtjfbcioz"
2 changes: 1 addition & 1 deletion .env.production
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
VITE_OPEN_SAUCED_INSIGHTS_DOMAIN = "insights.opensauced.pizza"
VITE_OPEN_SAUCED_INSIGHTS_DOMAIN = "app.opensauced.pizza"
VITE_OPEN_SAUCED_API_ENDPOINT = "https://api.opensauced.pizza/v1"
VITE_OPEN_SAUCED_SUPABASE_ID = "ibcwmlhcimymasokhgvn"
2 changes: 1 addition & 1 deletion .env.test
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
VITE_OPEN_SAUCED_INSIGHTS_DOMAIN = "beta.insights.opensauced.pizza"
VITE_OPEN_SAUCED_INSIGHTS_DOMAIN = "beta.app.opensauced.pizza"
VITE_OPEN_SAUCED_API_ENDPOINT = "https://beta.api.opensauced.pizza/v1"
VITE_OPEN_SAUCED_SUPABASE_ID = "fcqqkxwlntnrtjfbcioz"
4 changes: 2 additions & 2 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ module.exports = {
jest: true,
es2021: true,
},
ignorePatterns: ["test", "dist", "build", "public", "/**/node_modules/*", ".eslintrc.js", "vite.config.ts", "vite-env.d.ts", "postcss.config.js", "tailwind.config.js", "vitest.config.ts"],
ignorePatterns: ["test", "dist", "build", "public", "/**/node_modules/*", ".eslintrc.js", "vite.config.ts", "vite-env.d.ts", "postcss.config.js", "tailwind.config.js", "vitest.config.ts", "playwright.config.ts", "e2e"],
rules: {
"indent": "off",
"@typescript-eslint/indent": "error",
Expand Down Expand Up @@ -449,4 +449,4 @@ module.exports = {
"@typescript-eslint/parser": [".js", ".jsx", ".ts", ".tsx"],
},
},
};
};
3 changes: 3 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@open-sauced/triage
@diivi
@Anush008
13 changes: 4 additions & 9 deletions .github/workflows/development.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,11 @@ jobs:
- name: "☁️ checkout repository"
uses: actions/checkout@v2

- name: "🔧 setup node"
uses: actions/[email protected]
with:
node-version: 18

- name: "🔧 install npm@latest"
run: npm i -g npm@latest
- name: "🔧 setup Bun"
uses: oven-sh/setup-bun@v1

- name: "📦 install dependencies"
uses: bahmutov/npm-install@v1
run: bun install

- name: "📦 run build"
run: npm run build
run: bun run build
26 changes: 26 additions & 0 deletions .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Playwright Tests
on:
push:
branches: [ main, beta ]
pull_request:
branches: [ main, beta ]
jobs:
test:
timeout-minutes: 60
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: "🔧 setup Bun"
uses: oven-sh/setup-bun@v1
- name: Install dependencies
run: bun install
- name: Install Playwright Browsers
run: bun x playwright install --with-deps
- name: Run Playwright tests
run: bun x playwright test
- uses: actions/upload-artifact@v3
if: always()
with:
name: playwright-report
path: playwright-report/
retention-days: 30
15 changes: 5 additions & 10 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,19 +31,14 @@ jobs:
- name: "☁️ checkout repository"
uses: actions/checkout@v3

- name: "🔧 setup node"
uses: actions/setup-node@v3
with:
node-version: 18.x

- name: "🔧 install npm@latest"
run: npm i -g npm@latest
- name: "🔧 setup Bun"
uses: oven-sh/setup-bun@v1

- name: "📦 install dependencies"
uses: bahmutov/npm-install@v1
run: bun install

- name: "🚀 static app"
run: npm run build
run: bun run build

- name: "📂 production artifacts"
uses: actions/upload-artifact@v2
Expand All @@ -54,7 +49,7 @@ jobs:
release:
environment:
name: ${{ needs.setup.outputs.DEPLOY_ENVIRONMENT }}
url: https://${{ needs.setup.outputs.DEPLOY_SUBDOMAIN }}insights.opensauced.pizza
url: https://${{ needs.setup.outputs.DEPLOY_SUBDOMAIN }}app.opensauced.pizza
name: Semantic release
needs:
- setup
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/triage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ jobs:
timeout-minutes: 10
steps:
- name: take an issue
uses: bdougie/take-action@main
uses: bdougie/take-action@v1.6.1
with:
issueCurrentlyAssignedMessage: Thanks for being interested in this issue. It looks like this ticket is already assigned to a contributor.
token: ${{ secrets.GITHUB_TOKEN }}
blockingLabels: 👀 needs triage,🛑 blocked,core team work,🖍need-design,duplicate
blockingLabelsMessage: The issue you are trying to assign yourself is blocked until it can be triaged or by another label on the issue.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,6 @@ dist-ssr
*.njsproj
*.sln
*.sw?
/test-results/
/playwright-report/
/playwright/.cache/
42 changes: 42 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,48 @@

> All notable changes to this project will be documented in this file
## [1.14.1-beta.6](https://github.com/open-sauced/ai/compare/v1.14.1-beta.5...v1.14.1-beta.6) (2023-11-01)


### 🐛 Bug Fixes

* login to the website after rename ([1070a0c](https://github.com/open-sauced/ai/commit/1070a0c2693cf46d99219f4fe3b102032ce6a671))

## [1.14.1-beta.5](https://github.com/open-sauced/ai/compare/v1.14.1-beta.4...v1.14.1-beta.5) (2023-09-21)


### 🔁 Continuous Integration

* bun install, x ([#265](https://github.com/open-sauced/ai/issues/265)) ([6c765e0](https://github.com/open-sauced/ai/commit/6c765e05e16c8d90c3a2638328e7df4a32e83b14))

## [1.14.1-beta.4](https://github.com/open-sauced/ai/compare/v1.14.1-beta.3...v1.14.1-beta.4) (2023-09-18)


### 🐛 Bug Fixes

* linkedin projects share ([#264](https://github.com/open-sauced/ai/issues/264)) ([481472b](https://github.com/open-sauced/ai/commit/481472bf073f5c8d4c279ec13b751ab827a2c50f))

## [1.14.1-beta.3](https://github.com/open-sauced/ai/compare/v1.14.1-beta.2...v1.14.1-beta.3) (2023-09-01)


### ✅ Tests

* setup playwright for e2e testing ([#262](https://github.com/open-sauced/ai/issues/262)) ([fc9acca](https://github.com/open-sauced/ai/commit/fc9acca13bd0ea97173eb81598037244272bc4ea))

## [1.14.1-beta.2](https://github.com/open-sauced/ai/compare/v1.14.1-beta.1...v1.14.1-beta.2) (2023-08-22)


### 🐛 Bug Fixes

* prevent error when viewing repo and not logged in ([#260](https://github.com/open-sauced/ai/issues/260)) ([05fcf5e](https://github.com/open-sauced/ai/commit/05fcf5ea658e34472fc0913d1154b03ceca87e8b))

## [1.14.1-beta.1](https://github.com/open-sauced/ai/compare/v1.14.0...v1.14.1-beta.1) (2023-08-15)


### 🐛 Bug Fixes

* syntax error being thrown in Firefox for anonymous objects with computed property names ([#241](https://github.com/open-sauced/ai/issues/241)) ([00ba2c8](https://github.com/open-sauced/ai/commit/00ba2c8408486bcdba4698848b52adf0f807cc2a))

## [1.14.0](https://github.com/open-sauced/ai/compare/v1.13.0...v1.14.0) (2023-08-15)


Expand Down
6 changes: 6 additions & 0 deletions e2e/open-popup.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { test, expect } from './popupFixture';

test('popup page', async ({ page, extensionId }) => {
await page.goto(`chrome-extension://${extensionId}/index.html`);
expect(page.locator('body')).toBeTruthy();
});
30 changes: 30 additions & 0 deletions e2e/popupFixture.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import { test as base, chromium, type BrowserContext } from "@playwright/test";
import path from "path";

export const test = base.extend<{
context: BrowserContext;
extensionId: string;
}>({
context: async ({}, use) => {
const pathToExtension = path.join(__dirname, "../dist");
const context = await chromium.launchPersistentContext("", {
headless: false,
args: [
`--headless=new`,
`--disable-extensions-except=${pathToExtension}`,
`--load-extension=${pathToExtension}`,
],
});
await use(context);
await context.close();
},
extensionId: async ({ context }, use) => {
let [background] = context.serviceWorkers();
if (!background) background = await context.waitForEvent("serviceworker");

const extensionId = background.url().split("/")[2];
await use(extensionId);
},
});

export const expect = test.expect;
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@
"48": "src/assets/os-icons/os-icon-48.png",
"128": "src/assets/os-icons/os-icon-128.png"
},
"host_permissions": ["https://github.com/*", "https://*.insights.opensauced.pizza/*" , "https://www.linkedin.com/*"],
"host_permissions": ["https://github.com/*", "https://*.app.opensauced.pizza/*" , "https://www.linkedin.com/*"],
"permissions": ["scripting", "storage", "tabs", "cookies"]
}
36 changes: 34 additions & 2 deletions npm-shrinkwrap.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "opensauced-browser-extension",
"private": true,
"version": "1.14.0",
"version": "1.14.1-beta.6",
"files": [
"dist"
],
Expand All @@ -12,6 +12,7 @@
"lint": "eslint . --report-unused-disable-directives",
"format": "npm run lint -- --fix",
"test": "vitest run",
"e2e": "npx playwright test",
"coverage": "vitest run --coverage"
},
"dependencies": {
Expand All @@ -29,6 +30,7 @@
},
"devDependencies": {
"@crxjs/vite-plugin": "^1.0.14",
"@playwright/test": "^1.37.1",
"@types/chrome": "^0.0.237",
"@types/node": "^20.1.4",
"@types/node-emoji": "^1.8.2",
Expand Down
45 changes: 45 additions & 0 deletions playwright.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import { defineConfig, devices } from '@playwright/test';

/**
* See https://playwright.dev/docs/test-configuration.
*/
export default defineConfig({
testDir: './e2e',
/* Run tests in files in parallel */
fullyParallel: true,
/* Fail the build on CI if you accidentally left test.only in the source code. */
forbidOnly: !!process.env.CI,
/* Retry on CI only */
retries: process.env.CI ? 2 : 0,
/* Opt out of parallel tests on CI. */
workers: process.env.CI ? 1 : undefined,
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
reporter: 'html',
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
use: {
/* Base URL to use in actions like `await page.goto('/')`. */
// baseURL: 'http://127.0.0.1:3000',

/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
trace: 'on-first-retry',
},

/* Configure projects for major browsers */
projects: [
{
name: 'chromium',
use: { ...devices['Desktop Chrome'] },
},
// {
// name: 'firefox',
// use: { ...devices['Desktop Firefox'] },
// },
],

/* Run your local dev server before starting the tests */
webServer: {
command: 'npm run dev',
url: 'http://127.0.0.1:3000',
reuseExistingServer: !process.env.CI,
},
});
3 changes: 2 additions & 1 deletion src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export const OPEN_SAUCED_HIGHLIGHT_ENDPOINT = `${OPEN_SAUCED_API_ENDPOINT}/highl
export const OPEN_SAUCED_HIGHLIGHTS_LIST_ENDPOINT = `${OPEN_SAUCED_API_ENDPOINT}/highlights/list`;
export const OPEN_SAUCED_EMOJIS_ENDPOINT = `${OPEN_SAUCED_API_ENDPOINT}/emojis`;

// GitHub constants/selectors
// Content-scripts selectors
export const GITHUB_PROFILE_MENU_SELECTOR = ".p-nickname.vcard-username.d-block";
export const GITHUB_PROFILE_EDIT_MENU_SELECTOR = "button.js-profile-editable-edit-button";
export const GITHUB_PROFILE_USER_PROFILE_BIO_SELECTOR = ".p-note.user-profile-bio.mb-3.js-user-profile-bio.f4";
Expand All @@ -41,6 +41,7 @@ export const GITHUB_REPO_ACTIONS_SELECTOR = ".pagehead-actions";
export const GITHUB_PR_COMMENT_TEXT_AREA_SELECTOR = "pull_request[body]";
export const GITHUB_PR_SUGGESTION_TEXT_AREA_SELECTOR = "[name='comment[body]']";
export const GITHUB_PR_BASE_BRANCH_SELECTOR = "css-truncate css-truncate-target";
export const LINKEDIN_PROJECT_FORM_SELECTOR = ".artdeco-text-input--input";

// External Links
export const EXTERNAL_RESOURCES = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export const DescriptionGeneratorButton = () => {
innerHTML: `<span id="ai-description-gen" class="toolbar-item btn-octicon">
<img class="octicon octicon-heading" height="16px" width="16px" id="ai-description-button-logo" src=${chrome.runtime.getURL(openSaucedLogoIcon)}>
</span>
<tool-tip for="ai-description-gen">Generate PR description</tool-tip>`,
<tool-tip for="ai-description-gen" popover="manual">Generate PR description</tool-tip>`,
onclick: handleSubmit,
});

Expand Down
Loading

0 comments on commit abffdf3

Please sign in to comment.