Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
151 commits
Select commit Hold shift + click to select a range
f9668e3
Initial commit
Feb 14, 2023
78a565d
Add list repositories and get repository methods
vermakhushboo Feb 14, 2023
6abc117
Added call method to Adapter and basic tests
vermakhushboo Feb 14, 2023
8339ba6
Add APIs to add and update comment
vermakhushboo Feb 15, 2023
f09655f
Added dockerfile
vermakhushboo Feb 15, 2023
5e130c4
Add download repository zip method
vermakhushboo Feb 17, 2023
68d1605
Add forkRepository() method
vermakhushboo Feb 20, 2023
d6efcf5
Add CONTRIBUTING.md, CODE_OF_CONDUCT.md and updated README
vermakhushboo Feb 21, 2023
edfd361
Update Utopia-php/framework version
vermakhushboo Mar 1, 2023
2d56fe8
Add download as tar method
vermakhushboo Mar 1, 2023
651c21a
Make username the last and optional param in constructor
vermakhushboo Mar 14, 2023
8874fe0
Added method to generate git clone command
vermakhushboo Mar 14, 2023
aeb360f
Updated git clone method
vermakhushboo Mar 21, 2023
693e076
Added parsePayload method
vermakhushboo Mar 30, 2023
0209e6e
Modified parseWebhookEventPayload method
vermakhushboo Apr 3, 2023
8be42d2
Return installationId also in parsed payload
vermakhushboo Apr 5, 2023
9724b1d
Updated git clone command
vermakhushboo Apr 5, 2023
5b16cd7
Add logic to parse pull request payload
vermakhushboo Apr 5, 2023
73e743b
Updated git clone command
vermakhushboo Apr 6, 2023
fbc4071
Parse GitHub App Uninstallation payload
vermakhushboo Apr 11, 2023
ddc24ef
Added description to parsePayload method
vermakhushboo Apr 11, 2023
e790e4b
Added constants for push, PR and other events
vermakhushboo Apr 11, 2023
6150fae
Remove unneeded dependency
Meldiron Apr 14, 2023
417f244
Update lockfile
Meldiron Apr 14, 2023
59e6f1c
Added pullRequestNumber and repoName in PR payload
vermakhushboo Apr 18, 2023
8202c3f
Merge branch 'feat-git-adapter' of github.com:utopia-php/vcs into fea…
vermakhushboo Apr 18, 2023
2fde15e
Update add and update comment methodd
vermakhushboo Apr 18, 2023
297a6dc
Return action in parsed payload
vermakhushboo Apr 19, 2023
18a6aa2
Added getRepositoryName function
vermakhushboo Apr 23, 2023
083d0a0
Added updateCommitStatus method
vermakhushboo May 3, 2023
5668309
Added commitSHA and repoName to push payload
vermakhushboo May 4, 2023
2b9da9c
Use ownerName instead of App name in updateCommitStatus
vermakhushboo May 5, 2023
018042e
Added owner as param
vermakhushboo May 8, 2023
f46e635
Add searchRepos method
vermakhushboo May 10, 2023
5c1e622
Parse name of user who installed app
vermakhushboo May 10, 2023
a8c0cee
Also parse payload on permission updated
vermakhushboo May 12, 2023
8a1e3b9
Added var_dump
vermakhushboo May 12, 2023
3f0b12b
Added page number and per_page query params to list repos
vermakhushboo May 17, 2023
93eeea2
Added getTotalReposCount method
vermakhushboo May 17, 2023
774b642
Updated utopia framework version
vermakhushboo May 22, 2023
a3f5d68
Add getOwnerName method
vermakhushboo May 22, 2023
198669f
Added listBranches method
vermakhushboo May 25, 2023
de47396
Return names of branches instead of payload
vermakhushboo May 25, 2023
220a93e
Fixed formatting, added cache
Meldiron May 26, 2023
1331193
Fix tests
Meldiron May 26, 2023
9215381
add getComment
Meldiron May 28, 2023
30b9c91
WIP: Auto-Runtime Detection
vermakhushboo Jun 4, 2023
f25e749
Fix imports
Meldiron Jun 4, 2023
418df43
Fix check languages array logic
vermakhushboo Jun 6, 2023
911900d
Add getRepositoryLanguages method
vermakhushboo Jun 6, 2023
e0246bb
Add listRepositoryContents method
vermakhushboo Jun 6, 2023
6a5e3aa
Updated detector test
vermakhushboo Jun 6, 2023
27c6662
Update src/Detector/Adapter/JavaScript.php
vermakhushboo Jun 7, 2023
832b165
Removed vlucas dependency
vermakhushboo Jun 7, 2023
d919ac9
Pass and to DetectorFactory
vermakhushboo Jun 7, 2023
a13e2e3
Renamed files as per adapter pattern
vermakhushboo Jun 7, 2023
023cc8c
Add getRepository
Meldiron Jun 7, 2023
927140b
Add shallow clone and rootDirectory to clone
Meldiron Jun 7, 2023
eefb162
Added more detectors
vermakhushboo Jun 10, 2023
3e606fb
New adapter approach PoC
Meldiron Jun 10, 2023
7011a59
Better multi-extension support
Meldiron Jun 10, 2023
a5ac92a
New adapter approach
vermakhushboo Jun 10, 2023
416405c
Return languages as strings instead of pair
vermakhushboo Jun 10, 2023
19df1db
Add tests for all detectors
vermakhushboo Jun 10, 2023
46f4de3
Rename Cpp.php to CPP.php
vermakhushboo Jun 12, 2023
01afc32
Add validateWebhook
Meldiron Jun 15, 2023
f34e6e5
Add getPullRequest
Meldiron Jun 16, 2023
2f1ecff
add debugs
Meldiron Jun 16, 2023
2966e48
Fix method
Meldiron Jun 16, 2023
06e0f27
Add createRepository
Meldiron Jun 17, 2023
7fb5b73
Fix endpoint
Meldiron Jun 17, 2023
4e03124
Updated git clone command
vermakhushboo Jun 19, 2023
df56d0e
Added var_dump
vermakhushboo Jun 19, 2023
36e0bff
Fix clone command
Meldiron Jun 21, 2023
8eb6558
Fix missing branch edge case
Meldiron Jun 21, 2023
3d517a6
Prevent warning
Meldiron Jun 21, 2023
64e6769
Fix branch warning
Meldiron Jun 21, 2023
ee673c8
Update GitHub.php
Meldiron Jun 21, 2023
f39f18e
Fix exit code
Meldiron Jun 21, 2023
bc20bfb
Disable empty repos in git clone
Meldiron Jun 21, 2023
6131630
Existing repo support
Meldiron Jun 22, 2023
e20c411
Add SHA to PR event
Meldiron Jun 26, 2023
764cff0
Add isExternal to PR
Meldiron Jun 27, 2023
80d1fa3
Add getPullRequest()
Meldiron Jun 28, 2023
580474f
Add placehollders for consistency
Meldiron Jun 28, 2023
abb9fcc
Update README.md
vermakhushboo Jul 6, 2023
1f9c5e9
Add assertions to existing tests
vermakhushboo Jul 6, 2023
5bd0354
Fixed formatting
vermakhushboo Jul 6, 2023
65b4365
Add tests for more methods
vermakhushboo Jul 6, 2023
14cec75
Create add-new-adapter.md
vermakhushboo Jul 7, 2023
7181c9c
Add steps to add new detector
vermakhushboo Jul 7, 2023
c4cbcce
Fixed formatting
vermakhushboo Jul 10, 2023
40c4683
Update getting started steps
vermakhushboo Jul 10, 2023
65f75d1
Add CI/CD
Meldiron Jul 10, 2023
3136a45
Fix phpstan
Meldiron Jul 10, 2023
59f6c51
Fix some code QL errors
Meldiron Jul 10, 2023
ecfe36f
Add tests CI/CD
Meldiron Jul 10, 2023
86cda7a
Fix test
Meldiron Jul 10, 2023
de46927
Simplify CI/CD test
Meldiron Jul 10, 2023
da63540
Update add-new-adapter.md
vermakhushboo Jul 10, 2023
ecf407c
Fix missing logs
Meldiron Jul 10, 2023
bf4653b
Merge branch 'feat-git-adapter' of https://github.com/utopia-php/vcs …
Meldiron Jul 10, 2023
de6e83f
Fix empty rootDirectory
Meldiron Jul 10, 2023
930cf1a
Update README.md
vermakhushboo Jul 10, 2023
d0e3582
Fixed PHPStan errors
vermakhushboo Jul 11, 2023
1067890
Resolve warnings
Meldiron Jul 11, 2023
1dda6d4
Fixed tests
vermakhushboo Jul 11, 2023
7ef28e6
Resolved merge conflict
vermakhushboo Jul 11, 2023
8cf9268
Fixed PHPStan errors
vermakhushboo Jul 11, 2023
de8a376
Updated secret names
vermakhushboo Jul 11, 2023
cda0728
Add env variables to CI/CD workflow
vermakhushboo Jul 11, 2023
2fa461e
Debugging
vermakhushboo Jul 11, 2023
827fdf3
More debugging
vermakhushboo Jul 11, 2023
7b5c7f0
Tests passing
vermakhushboo Jul 11, 2023
778a104
Updated logic for empty root directory
vermakhushboo Jul 17, 2023
1d2d648
Testing
vermakhushboo Jul 17, 2023
57eba51
Fixed and tested
vermakhushboo Jul 17, 2023
9611f7d
Added base.php to make tests extensible
vermakhushboo Jul 19, 2023
431a27f
Add interface for Git methods
vermakhushboo Jul 19, 2023
6bf14fc
Moved method signatures to adapter.php
vermakhushboo Jul 20, 2023
c836cb5
Standardise method names
vermakhushboo Jul 20, 2023
20d3903
Fix external contributions property
vermakhushboo Jul 21, 2023
e64e93d
WIP: Move definitions to base git class
vermakhushboo Jul 23, 2023
9c9c0e8
Moved definitions to base test class
vermakhushboo Jul 23, 2023
4c9bf5a
Change parseWebhookEvent to getEvent
vermakhushboo Jul 24, 2023
6fc2f0d
Rename add-new-adapter.md to add-new-detector-adapter.md
vermakhushboo Jul 24, 2023
9babb9b
Update CONTRIBUTING.md
vermakhushboo Jul 24, 2023
a069030
Create add-new-vcs-adapter.md
vermakhushboo Jul 24, 2023
7e129dc
Update add-new-vcs-adapter.md
vermakhushboo Jul 24, 2023
61a2c13
Update README.md
vermakhushboo Jul 24, 2023
059f0d3
Update CONTRIBUTING.md
vermakhushboo Jul 24, 2023
81150e6
Upgrade libs
Meldiron Aug 6, 2023
3b1138f
Upgrade framework lib
Meldiron Aug 7, 2023
b43af0b
Add additional information to deployments
vermakhushboo Aug 7, 2023
c33c9e9
Merge branch 'feat-git-adapter' of github.com:utopia-php/vcs into fea…
vermakhushboo Aug 7, 2023
051b973
Updated payloads
vermakhushboo Aug 9, 2023
315ea5d
Fixed formatting
vermakhushboo Aug 9, 2023
214619a
Add method to fetch latest commit on brancg
vermakhushboo Aug 9, 2023
6ee80b5
Check if new branch is created
vermakhushboo Aug 9, 2023
048af6b
Organize Code and rename "listRepositoriesForVCSApp" to "listReposito…
PineappleIOnic Aug 9, 2023
dfdfcd4
Continue renaming functions
PineappleIOnic Aug 9, 2023
c8164bd
Update Func Names
PineappleIOnic Aug 9, 2023
5cdcdf6
Fix failing tests
vermakhushboo Aug 9, 2023
07d60e8
Added null safety checks
vermakhushboo Aug 9, 2023
bc9da56
Update urls
vermakhushboo Aug 9, 2023
9f1665c
Add authorUrl to pull request response
vermakhushboo Aug 9, 2023
ce39443
Resolve PR comments
vermakhushboo Aug 9, 2023
489e956
Remove env variables not being used from docker-compose
vermakhushboo Aug 9, 2023
66ce4af
Update README.md
vermakhushboo Aug 9, 2023
482ff56
Update README.md
vermakhushboo Aug 9, 2023
488ddba
Fixed clone command to protect from shell injection
vermakhushboo Aug 9, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: "CodeQL"

on: [pull_request]
jobs:
lint:
name: CodeQL
runs-on: ubuntu-latest

steps:
- name: Check out the repo
uses: actions/checkout@v2

- name: Run CodeQL
run: |
docker run --rm -v $PWD:/app composer sh -c \
"composer install --profile --ignore-platform-reqs && composer check"
16 changes: 16 additions & 0 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: "Linter"

on: [pull_request]
jobs:
lint:
name: Linter
runs-on: ubuntu-latest

steps:
- name: Check out the repo
uses: actions/checkout@v2

- name: Run Linter
run: |
docker run --rm -v $PWD:/app composer sh -c \
"composer install --profile --ignore-platform-reqs && composer lint"
30 changes: 30 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: "Tests"

on: [pull_request]
jobs:
tests:
name: Tests
runs-on: ubuntu-latest

steps:
- name: Check out the repo
uses: actions/checkout@v2

- name: Start Test Stack
env:
PRIVATE_KEY: ${{ secrets.PRIVATE_KEY }}
APP_IDENTIFIER: ${{ secrets.APP_IDENTIFIER }}
INSTALLATION_ID: ${{ secrets.INSTALLATION_ID }}
run: |
docker compose up -d
sleep 15

- name: Doctor
run: |
docker compose logs
docker ps
docker network ls

- name: Run Tests
run: |
docker-compose exec -T tests vendor/bin/phpunit --configuration phpunit.xml tests
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/vendor/
/.idea/
.phpunit.result.cache
.env
.DS_Store
76 changes: 76 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# Contributor Covenant Code of Conduct

## Our Pledge

In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to make participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, sex characteristics, gender identity, expression,
level of experience, education, socio-economic status, 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 team@appwrite.io. 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 https://www.contributor-covenant.org/version/1/4/code-of-conduct.html

[homepage]: https://www.contributor-covenant.org

For answers to common questions about this code of conduct, see
https://www.contributor-covenant.org/faq
109 changes: 109 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
# Contributing

We would ❤️ for you to contribute to Utopia-php and help make it better! We want contributing to Utopia-php to be fun, enjoyable, and educational for anyone and everyone. All contributions are welcome, including issues, new docs as well as updates and tweaks, blog posts, workshops, and more.

## How to Start?

If you are worried or don’t know where to start, check out our next section explaining what kind of help we could use and where can you get involved. You can reach out with questions to [Eldad Fux (@eldadfux)](https://twitter.com/eldadfux) or anyone from the [Appwrite team on Discord](https://appwrite.io/discord). You can also submit an issue, and a maintainer can guide you!

## Code of Conduct

Help us keep Utopia-php open and inclusive. Please read and follow our [Code of Conduct](https://github.com/utopia-php/abuse/blob/master/CODE_OF_CONDUCT.md).

## Submit a Pull Request 🚀

Branch naming convention is as following

```
TYPE-ISSUE_ID-DESCRIPTION
```

example:

```
doc-548-submit-a-pull-request-section-to-contribution-guide
```

When `TYPE` can be:

- **feat** - is a new feature
- **doc** - documentation only changes
- **cicd** - changes related to CI/CD system
- **fix** - a bug fix
- **refactor** - code change that neither fixes a bug nor adds a feature

**All PRs must include a commit message with the changes description!**

For the initial start, fork the project and use git clone command to download the repository to your computer. A standard procedure for working on an issue would be to:

1. `git pull`, before creating a new branch, pull the changes from upstream. Your master needs to be up to date.

```
$ git pull
```

2. Create new branch from `master` like: `doc-548-submit-a-pull-request-section-to-contribution-guide`

```
$ git checkout -b [name_of_your_new_branch]
```

3. Work - commit - repeat ( be sure to be in your branch )

4. Push changes to GitHub

```
$ git push origin [name_of_your_new_branch]
```

6. Submit your changes for review If you go to your repository on GitHub, you'll see a `Compare & pull request` button. Click on that button.

7. Start a Pull Request Now submit the pull request and click on `Create pull request`.

8. Get a code review approval/reject

9. After approval, merge your PR

10. GitHub will automatically delete the branch after the merge is done. (they can still be restored).

## Introducing New Features

We would 💖 you to contribute to Utopia-php, but we would also like to make sure Utopia-php is as great as possible and loyal to its vision and mission statement 🙏.

For us to find the right balance, please open an issue explaining your ideas before introducing a new pull request.

This will allow the Utopia-php community to have sufficient discussion about the new feature value and how it fits in the product roadmap and vision.

This is also important for the Utopia-php lead developers to be able to give technical input and different emphasis regarding the feature design and architecture. Some bigger features might need to go through our [RFC process](https://github.com/appwrite/rfc).

## Adding A New Adapter

You can follow our [Adding new VCS Adapter](docs/add-new-vcs-adapter.md) tutorial to add a new VCS adapter like GitLab, Bitbucket etc. and [Adding new Detector Adapter](docs/add-new-detector-adapter.md) tutorial to add new detector support in this library.

## Other Ways to Help

Pull requests are great, but there are many other areas where you can help Utopia-php.

### Blogging & Speaking

Blogging, speaking about, or creating tutorials about one of Utopia-php’s many features is great way to contribute and help our project grow.

### Presenting at Meetups

Presenting at meetups and conferences about your Utopia-php projects. Your unique challenges and successes in building things with Utopia-php can provide great speaking material. We’d love to review your talk abstract/CFP, so get in touch with us if you’d like some help!

### Sending Feedbacks & Reporting Bugs

Sending feedback is a great way for us to understand your different use cases of Utopia-php better. If you had any issues, bugs, or want to share about your experience, feel free to do so on our GitHub issues page or at our [Discord channel](https://discord.gg/GSeTUeA).

### Submitting New Ideas

If you think Utopia-php could use a new feature, please open an issue on our GitHub repository, stating as much information as you can think about your new idea and it's implications. We would also use this issue to gather more information, get more feedback from the community, and have a proper discussion about the new feature.

### Improving Documentation

Submitting documentation updates, enhancements, designs, or bug fixes. Spelling or grammar fixes will be very much appreciated.

### Helping Someone

Searching for Utopia-php, GitHub or StackOverflow and helping someone else who needs help. You can also help by teaching others how to contribute to Utopia-php's repo!
25 changes: 25 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
FROM composer:2.0 as composer

ARG TESTING=false
ENV TESTING=$TESTING

WORKDIR /usr/local/src/

COPY composer.lock /usr/local/src/
COPY composer.json /usr/local/src/

RUN composer install \
--ignore-platform-reqs \
--optimize-autoloader \
--no-plugins \
--no-scripts \
--prefer-dist

FROM php:8.0-cli-alpine

WORKDIR /usr/local/src/

COPY --from=composer /usr/local/src/vendor /usr/local/src/vendor
COPY . /usr/local/src/

CMD [ "tail", "-f", "/dev/null" ]
Loading