forked from confused-Techie/atom-backend
-
-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Laying the groundwork for the git
refactor
#50
Merged
Merged
Changes from 42 commits
Commits
Show all changes
50 commits
Select commit
Hold shift + click to select a range
a4af6c1
Laying the groundwork for the `git` refactor
confused-Techie d46a55a
Use `switch` for comparison, remove `lowercase()` external usage
confused-Techie 0a13702
Added Codeberg VCS detection
confused-Techie 53f3fce
Avoid semicolon auto-insertion, start specifying git class
confused-Techie 76728aa
Framework of VCS Services, and testing them
confused-Techie f05b84d
Full testing suite written for GitHub `doesUserHaveRepo`
confused-Techie f4292dc
Updated `codeql` to ignore new testing location
confused-Techie 1ccf4ae
Update fixture file name
confused-Techie 67d4cbb
Move heavy lifting into `github.js` for ownership returns
confused-Techie abbbaa8
Fix typo `unkown` => `unknown`
confused-Techie 60de1c4
Use new endpoint to find user ownership, new tests
confused-Techie 33fbfab
`readme` & docs
confused-Techie d1140a3
Some more tests for new `readme` function
confused-Techie c77dfd4
Additional layout of core API structure
confused-Techie 5ce374b
Merge branch 'main' into refactor-git
confused-Techie af71577
fix CodeQL issues
Digitalone1 872d107
github class: use const where possible
Digitalone1 850ea37
use an internal initializer and introduce private properties
Digitalone1 89e755a
camelCase properties + fix base class setters
Digitalone1 f3b609d
git class: remove setters and add jsdoc to methods
Digitalone1 fd84d66
Complete the specific components of the GitHub VCS Module
confused-Techie e0a4ddd
Fixed Undeclared Variable
confused-Techie 2919648
Fix Syntax Error
confused-Techie d88fca7
Documentation, and refining exports and scope of responsibilites
confused-Techie fd69cf8
Progress on Publishing functionality
confused-Techie ee592e6
Some comments
confused-Techie d802f4b
Finish `newPackageData` begin fleshing out other functions
confused-Techie cfbd3a3
Fixed syntax error on ternary operator
confused-Techie 9c92be4
Methodology to reduce repetitious package handling
confused-Techie d69a4c8
Initial construction of `package_json` class
confused-Techie 99c2c8c
Continuing work on having easy interactions with package.json data
confused-Techie 00dd86c
Merge remote-tracking branch 'upstream/refactor-git' into refactor-git
Digitalone1 bbddd30
fix CodeQL issues + typeof to check "function"
Digitalone1 080a7b7
Merge pull request #56 from Digitalone1/refactor-git
confused-Techie f7480f4
timestamps set by PostgreSQL by default
Digitalone1 f79cbf1
fix lexical scoping in switch
Digitalone1 d15d39f
downloads and stars count auto-initialized by PostgreSQL to 0
Digitalone1 de4bdc4
Merge pull request #61 from Digitalone1/refactor-git
confused-Techie 7590a47
Fully Tested `vcs.newPackageData`
confused-Techie 45a5543
Fully tested `newVersionData` agnostic logic after service selection
confused-Techie 82e1ce9
Ownership tests, removed pseudo objects
confused-Techie 48a93b5
`deletePackageName` & `postPackageVersion` using VCS + Removed Outdat…
confused-Techie 3848b4c
Merge branch 'main' into refactor-git
confused-Techie 408ac9e
Fix the failing test from generic test runners
confused-Techie ea97df1
Utilize VCS for `deletePackagesName`
confused-Techie ac5bf87
Update `postPackagesVersion` use VCS auth for `deletePackagesVersion`…
confused-Techie ab93fcb
Better docs, publishPackage auth feature added to `vcs.ownership()`
confused-Techie 816cf70
Slight Refactor on VCS
confused-Techie 74861ec
Remove final usage of `git` in `package_handler.js`
confused-Techie 53cba5f
Remove unused variable
confused-Techie File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
const vcs = require("../vcs.js"); | ||
|
||
describe("determineProvider Returns as expected", () => { | ||
test("Returns null when no input is passed", () => { | ||
const res = vcs.determineProvider(); | ||
expect(res.type).toBe("na"); | ||
expect(res.url).toBe(""); | ||
}); | ||
test("Returns null when null input is passed", () => { | ||
const res = vcs.determineProvider(null); | ||
expect(res.type).toBe("na"); | ||
expect(res.url).toBe(""); | ||
}); | ||
test("Returns proper object, when object is passed", () => { | ||
const tmp = { type: "git", url: "https://github.com/confused-Techie/atom-backend" }; | ||
const res = vcs.determineProvider(tmp); | ||
expect(res.type).toBe(tmp.type); | ||
expect(res.url).toBe(tmp.url); | ||
}); | ||
test("Returns unknown VCS Object, when unkown is passed", () => { | ||
const tmp = "https://new-vcs.com/pulsar-edit/pulsar"; | ||
const res = vcs.determineProvider(tmp); | ||
expect(res.type).toBe("unknown"); | ||
expect(res.url).toBe(tmp); | ||
}); | ||
test("Returns unkown string when passed invalid data", () => { | ||
const tmp = 123; | ||
const res = vcs.determineProvider(tmp); | ||
expect(res.type).toBe("unknown"); | ||
expect(res.url).toBe(tmp); | ||
}); | ||
test("Returns proper GitHub Object, passed GitHub string", () => { | ||
const tmp = "https://github.com/confused-Techie/atom-backend"; | ||
const res = vcs.determineProvider(tmp); | ||
expect(res.type).toBe("git"); | ||
expect(res.url).toBe(tmp); | ||
}); | ||
test("Returns proper GitLab Object, passed GitLab string", () => { | ||
const tmp = "https://gitlab.com/clj-editors/atom-chlorine"; | ||
const res = vcs.determineProvider(tmp); | ||
expect(res.type).toBe("lab"); | ||
expect(res.url).toBe(tmp); | ||
}); | ||
test("Returns proper Sourceforge Object, when passed Sourceforge string", () => { | ||
const tmp = "https://sourceforge.net/projects/jellyfin.mirror/"; | ||
const res = vcs.determineProvider(tmp); | ||
expect(res.type).toBe("sfr"); | ||
expect(res.url).toBe(tmp); | ||
}); | ||
test("Returns proper Bitbucket Object, when passed Bitbucket string", () => { | ||
const tmp = "https://bitbucket.org/docker_alpine/alpine-jellyfin/src/master/"; | ||
const res = vcs.determineProvider(tmp); | ||
expect(res.type).toBe("bit"); | ||
expect(res.url).toBe(tmp); | ||
}); | ||
test("Returns proper Codeberg Object, when passed Codeberg string", () => { | ||
const tmp = "https://codeberg.org/itbastian/makemkv-move-extras"; | ||
const res = vcs.determineProvider(tmp); | ||
expect(res.type).toBe("berg"); | ||
expect(res.url).toBe(tmp); | ||
}); | ||
}); |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Check warning
Code scanning / CodeQL
Useless assignment to local variable