Skip to content
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

Add OpenTask #1617

Merged
merged 35 commits into from
Aug 31, 2021
Merged

Add OpenTask #1617

merged 35 commits into from
Aug 31, 2021

Conversation

jawira
Copy link
Contributor

@jawira jawira commented Jul 16, 2021

OpenTask opens a file or URL in the user's preferred application.

<open path="requirements.pdf"/>   // open pdf reader
<open path="http://localhost/"/>  // open browser

This should work in Linux, IOS and Windows. But, to be honest I have only tested this task in Ubuntu because I don't own an Apple nor a Windows PC.

Closes #1606

jawira and others added 26 commits February 11, 2019 14:27
@codecov
Copy link

codecov bot commented Jul 16, 2021

Codecov Report

Merging #1617 (31fe84a) into main (924fe09) will increase coverage by 0.07%.
The diff coverage is 97.05%.

Impacted file tree graph

@@             Coverage Diff              @@
##               main    #1617      +/-   ##
============================================
+ Coverage     57.67%   57.75%   +0.07%     
- Complexity     6934     6945      +11     
============================================
  Files           355      356       +1     
  Lines         16794    16828      +34     
============================================
+ Hits           9686     9719      +33     
- Misses         7108     7109       +1     
Impacted Files Coverage Δ
src/Phing/Task/Optional/OpenTask.php 97.05% <97.05%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 924fe09...31fe84a. Read the comment docs.

@mrook
Copy link
Member

mrook commented Jul 20, 2021

Thanks @jawira. Can this be automatically tested somehow? And can you write documentation in https://github.com/phingofficial/guide?

@jawira
Copy link
Contributor Author

jawira commented Jul 27, 2021

Thanks @jawira. Can this be automatically tested somehow? And can you write documentation in https://github.com/phingofficial/guide?

I will add some unit tests, if that's enough for you. I'm going to update the documentation as well.

@jawira jawira marked this pull request as draft July 27, 2021 21:51
@jawira
Copy link
Contributor Author

jawira commented Jul 29, 2021

@mrook I wrote some tests, surprisingly MacOS and Windows tests pass, but Ubuntu tests don't :( :( :(

I think the problem is xdg-open is not installed in ubuntu-latest image. Should I manually install xdg-open in Ubuntu's image? Any other suggestion?

@siad007
Copy link
Member

siad007 commented Jul 29, 2021

@jawira the problem with ubutu is that it is a plain headless image with no desktop preinstalled.

  • Either you use ubuntu:latest and install the dependencies you need or
  • you use another image with preinstalled desktop such like dorowu/ubuntu-desktop-lxde-vnc

For our test setup I would suggest to install xdg-open by adding following lines to the github action:

- name: Install xdg-utils
  run: sudo apt-get install xdg-utils

Also interesting project is https://github.com/technodelight/php-cli-cross-platform-open which could be included as a composer dependency.

FYI I tagged this issue as an external task (because of external dependencies) therefore it should be included in an own repo.

@jawira
Copy link
Contributor Author

jawira commented Aug 3, 2021

@siad007 I think OpenTask is ready.

  • I installed xdg-open on Ubuntu image. I used /usr/bin/true (this command always returns true) as a browser in order to not install more dependencies.
  • Let me know if you need help with the new OpenTask repo.
  • Checks in PHP 8.1 are not passing, but this is not related with OpenTask.
  • Also, could you please double check everything since I'm not GA expert.

@jawira jawira marked this pull request as ready for review August 3, 2021 17:37
@siad007
Copy link
Member

siad007 commented Aug 8, 2021

@jawira great stuff - will check ASAP

@mrook
Copy link
Member

mrook commented Aug 31, 2021

LGTM!

@mrook mrook merged commit 38d23e8 into phingofficial:main Aug 31, 2021
@jawira jawira deleted the open-task branch September 8, 2021 21:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

Task to open files and URLs
3 participants