diff --git a/.babelrc.js b/.babelrc.js
index aa85b91183..11bb2115a3 100644
--- a/.babelrc.js
+++ b/.babelrc.js
@@ -2,7 +2,7 @@ module.exports = {
sourceMaps: "inline",
plugins: [
"babel-plugin-relay",
- "./assert-messages-plugin.js",
+ `${__dirname}/assert-messages-plugin.js`,
"@atom/babel-plugin-chai-assert-async",
"@babel/plugin-proposal-class-properties",
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 7d30ce8063..1cee15a4ad 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -1,92 +1,65 @@
-name: ci
+name: CI
+
on:
pull_request:
push:
branches:
- - master
+ - master
+
+env:
+ # See https://github.com/pulsar-edit/pulsar/pull/46 for why we set this env variable.
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+
+ MOCHA_TIMEOUT: 60000
+ UNTIL_TIMEOUT: 30000
+
jobs:
- tests:
- name: tests
+ test:
+ name: Test
strategy:
matrix:
- os: [ubuntu-18.04, macos-latest, windows-2019]
- channel: [beta, nightly]
+ os: [ubuntu-20.04, ubuntu-latest, macos-latest, windows-2019]
fail-fast: false
runs-on: ${{ matrix.os }}
- env:
- ATOM_GITHUB_BABEL_ENV: coverage
- MOCHA_TIMEOUT: 60000
- UNTIL_TIMEOUT: 30000
steps:
- - uses: actions/checkout@v1
- - name: install Atom
- uses: UziTech/action-setup-atom@v1
- with:
- channel: ${{ matrix.channel }}
-
- - name: install dependencies
- run: apm ci
-
- - name: configure git
- shell: bash
- run: |
- git config --global user.name Hubot
- git config --global user.email hubot@github.com
-
- - name: Run the tests
- if: ${{ !contains(matrix.os, 'windows') }}
- run: atom --test test
-
- - name: Run the tests on Windows
- if: ${{ contains(matrix.os, 'windows') }}
- continue-on-error: true # due to https://github.com/atom/github/pull/2459#issuecomment-624725972
- run: atom --test test
-
- - name: report code coverage
- shell: bash
- env:
- CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
- SYSTEM_PULLREQUEST_PULLREQUESTNUMBER: ${{ github.event.number }}
- SYSTEM_PULLREQUEST_SOURCEBRANCH: ${{ github.head_ref }}
- BUILD_SOURCEBRANCH: ${{ github.event.ref }}
- OS_NAME: ${{ matrix.os }}
- run: |
- npm run report:coverage
- COVERAGE_NAME=$([[ "${OS_NAME}" == macos* ]] && echo "macOS" || echo "Linux")
- bash <(curl -s https://codecov.io/bash) \
- -n "${COVERAGE_NAME}" \
- -P "${SYSTEM_PULLREQUEST_PULLREQUESTNUMBER:-}" \
- -B "${SYSTEM_PULLREQUEST_SOURCEBRANCH:-${BUILD_SOURCEBRANCH}}"
- if: |
- !contains(matrix.os, 'windows') &&
- (success() || failure())
+ - name: Checkout the Latest Package Code
+ uses: actions/checkout@v3
+
+ - name: Setup Pulsar Editor
+ uses: pulsar-edit/action-pulsar-dependency@v3.2
+
+ - name: Install dependencies (Windows)
+ if: ${{ runner.os == 'Windows' }}
+ # Currently the Pulsar process starts, but unlike *nix doesn't wait for ppm to finish, probably because pulsar.cmd needs updated
+ # So we'll fallback to ppm (still named apm) instead
+ run: apm install --verbose
+
+ - name: Install dependencies (*nix)
+ if: ${{ runner.os != 'Windows' }}
+ run: pulsar --package install --verbose
+
+ # See https://github.com/atom/github/pull/2459#issuecomment-769487284
+ - name: Configure git
+ run: |
+ git config --global user.name Username
+ git config --global user.email username@github.com
+
+ - name: Run the headless Pulsar Tests
+ uses: coactions/setup-xvfb@v1.0.1
+ with:
+ #Ideally, the test folder should be renamed to spec to fall in-line with other conventions
+ run: pulsar --test test
+
lint:
- name: lint
- runs-on: ubuntu-18.04
+ name: Lint
+ runs-on: ubuntu-latest
steps:
- - uses: actions/checkout@v1
- - name: install Atom
- uses: UziTech/action-setup-atom@v1
- with:
- channel: nightly
- - name: install dependencies
- run: apm ci
- - name: lint
- run: npm run lint
+ - uses: actions/checkout@v3
+ - uses: actions/setup-node@v3
+ with:
+ node-version: 'lts/*'
+ - name: NPM install
+ run: npm install
+ - name: Lint ✨
+ run: npm run lint
- snapshot-tests:
- name: snapshot tests
- runs-on: ubuntu-18.04
- env:
- ATOM_GITHUB_BABEL_ENV: coverage
- ATOM_GITHUB_TEST_SUITE: snapshot
- steps:
- - uses: actions/checkout@v1
- - name: install Atom
- uses: UziTech/action-setup-atom@v1
- with:
- channel: nightly
- - name: install dependencies
- run: apm ci
- - name: run snapshot tests
- run: atom --test test/
diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md
deleted file mode 100644
index c7d7eeb143..0000000000
--- a/CODE_OF_CONDUCT.md
+++ /dev/null
@@ -1,46 +0,0 @@
-# Contributor Covenant 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 [atom@github.com](mailto:atom@github.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/
diff --git a/ISSUE_TEMPLATE.md b/ISSUE_TEMPLATE.md
deleted file mode 100644
index 42d963a11d..0000000000
--- a/ISSUE_TEMPLATE.md
+++ /dev/null
@@ -1,53 +0,0 @@
-
-
-### Prerequisites
-
-* Have you tried to reproduce the problem in [Safe Mode][safe-mode]?
-* Have you followed all applicable steps in the [debugging guide][debugging-guide]?
-* Have you checked the FAQs on the [message board][message-board] for common solutions?
-* Have you checked that your issue [isn't already filed][already-filed]?
-
-[safe-mode]: http://flight-manual.atom.io/hacking-atom/sections/debugging/#using-safe-mode
-[debugging-guide]: http://flight-manual.atom.io/hacking-atom/sections/debugging/
-[message-board]: https://discuss.atom.io/c/faq
-[already-filed]: https://github.com/atom/github/issues
-
-### Description
-
-
-
-### Steps to Reproduce
-
-1.
-2.
-3.
-
-**Expected behavior:**
-
-
-
-**Actual behavior:**
-
-
-
-**Reproduces how often:**
-
-
-
-### Platform and Versions
-
-What OS and version of OS are you running?
-
-What version of Atom are you using? You can get this information from copy and pasting the output of `atom --version` and `apm --version` from the command line.
-
-### Additional Information
-
-Please include any additional information, configuration or data that might be necessary to reproduce the issue. Screenshots, if appropriate, are helpful as well.
-
-If your issue involves a repository, and that repository is public, please include a link to it.
diff --git a/PULL_REQUEST_TEMPLATE.md b/PULL_REQUEST_TEMPLATE.md
deleted file mode 100644
index 1be3b35bc2..0000000000
--- a/PULL_REQUEST_TEMPLATE.md
+++ /dev/null
@@ -1,21 +0,0 @@
-**Please be sure to read the [contributor's guide to the GitHub package](https://github.com/atom/github/blob/master/CONTRIBUTING.md) before submitting any pull requests.**
-
-### Requirements
-
-* Filling out the template is required. Any pull request that does not include enough information to be reviewed in a timely manner may be closed at the maintainers' discretion.
-
-### Description of the Change
-
-
-
-### Screenshot or Gif
-
-
-
-### Applicable Issues
-
-
diff --git a/README.md b/README.md
index e43d03aff3..73cc49d74f 100644
--- a/README.md
+++ b/README.md
@@ -1,12 +1,8 @@
-# Atom GitHub Package
+# Pulsar GitHub Package
-| Build | Code Coverage |
-|-------|---------------|
-| [](https://github.com/atom/github/actions?query=workflow%3Aci+branch%3Amaster) | [](https://codecov.io/gh/atom/github) |
+The Pulsar GitHub package provides Git and GitHub integration for Pulsar.
-The Atom GitHub package provides Git and GitHub integration for Atom. Check out [github.atom.io](https://github.atom.io) for more information.
-
-
+
@@ -16,7 +12,7 @@ The Atom GitHub package provides Git and GitHub integration for Atom. Check out
## Installation
-This package is bundled with Atom starting in version 1.18, and does not need to be installed separately.
+This package is bundled with Pulsar starting in version 1.18, and does not need to be installed separately.
## License
diff --git a/lib/helpers.js b/lib/helpers.js
index 30e694bc98..027c514647 100644
--- a/lib/helpers.js
+++ b/lib/helpers.js
@@ -82,13 +82,18 @@ export function getPackageRoot() {
}
function getAtomAppName() {
+ /*
+ // Old Atom logic (restore this if we make release channel specific binaries)
const match = atom.getVersion().match(/-([A-Za-z]+)(\d+|-)/);
if (match) {
const channel = match[1];
- return `Atom ${channel.charAt(0).toUpperCase() + channel.slice(1)} Helper`;
+ return `Pulsar ${channel.charAt(0).toUpperCase() + channel.slice(1)} Helper`;
}
- return 'Atom Helper';
+ return 'Pulsar Helper';
+ */
+
+ return `${atom?.branding?.name ?? 'Pulsar'} Helper`;
}
export function getAtomHelperPath() {
diff --git a/lib/models/github-login-model.js b/lib/models/github-login-model.js
index d060a50bfb..219b4974e1 100644
--- a/lib/models/github-login-model.js
+++ b/lib/models/github-login-model.js
@@ -8,7 +8,7 @@ let instance = null;
export default class GithubLoginModel {
// Be sure that we're requesting at least this many scopes on the token we grant through github.atom.io or we'll
// give everyone a really frustrating experience ;-)
- static REQUIRED_SCOPES = ['repo', 'read:org', 'user:email']
+ static REQUIRED_SCOPES = ['public_repo', 'read:org', 'user:email']
static get() {
if (!instance) {
@@ -70,7 +70,25 @@ export default class GithubLoginModel {
for (const scope of this.constructor.REQUIRED_SCOPES) {
if (!scopeSet.has(scope)) {
+ if (scope === 'public_repo' && scopeSet.has('repo')) {
+ // 'repo' is a superset of, and implies, 'public_repo'.
+ // Setting just 'public_repo' or full 'repo' both have legitimate use-cases. So we won't warn about it.
+ continue;
+ }
+ if (scope === 'read:org' && scopeSet.has('admin:org')) {
+ // 'admin:org' is a superset of, and implies, 'read:org'.
+ console.warn('Excessive scopes detected on your github token. Please only set the actually needed scopes on your PAT.')
+ console.warn('Excessive scope "admin:org" should be "read:org" instead.')
+ continue;
+ }
+ if (scope === 'user:email' && scopeSet.has('user')) {
+ // 'user' is a superset of, and implies, 'user:email'.
+ console.warn('Excessive scopes detected on your github token. Please only set the actually needed scopes on your PAT.')
+ console.warn('Excessive scope "user" should be "user:email" instead.')
+ continue;
+ }
// Token doesn't have enough OAuth scopes, need to reauthenticate
+ console.log("GitHub token doesn't have a required scope! Missing: " + scope);
this.checked.set(fingerprint, INSUFFICIENT);
return INSUFFICIENT;
}
diff --git a/lib/views/git-tab-view.js b/lib/views/git-tab-view.js
index e149010a1f..3910939eac 100644
--- a/lib/views/git-tab-view.js
+++ b/lib/views/git-tab-view.js
@@ -218,8 +218,8 @@ export default class GitTabView extends React.Component {
.gitignore
file.
+ The repository at {this.props.workingDirectoryPath} has too many changed files to display
+ in {atom.branding.name}. Ensure that you have set up an appropriate .gitignore
file.