Giter Club home page Giter Club logo

scoop-githubactions's People

Contributors

ash258 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

scoop-githubactions's Issues

Hash failed due to new version

There is possible that hash will differ when new version is released (and URL is static; CCleaner stuff for example)

It would be good to first run checkver, wait for result.

  1. New version
    1. Comment about new version was released and there is need to wait for excavator
  2. No new version
    1. Just post PR with new hashes

`extract_dir` problem handler

This is pretty hard to handle as it require lots of manual checks.

It needs to be limited to 7z/zip files only.

Would it be more suitable to create scoop native binary for this?

"Excavator"

  • Implement actual action
  • Support env = { SPECIAL_SNOWFLAKES = 'curl,brotli' }
  • Support env = { SKIP_UPDATED = true }
  • Resolve how to post log into some issue (#20)
    • Or how to properly expose log for all users
  • Protected branches (#49)

Aria2 support for download action

Aria2 usage is now initialized. There are few problems that needs to be investigated

Starting download with aria2 ...
Exception caught
Exception: [download_helper.cc:563] errorCode=1 Failed to open the file /SCOOP/cache\xmake.txt, cause: File not found or it is a directory

ERROR Download failed! (Error 1) An unknown error occurred
ERROR https://github.com/xmake-io/xmake/releases/download/v2.2.7/xmake-v2.2.7.win64.zip
    referer=https://github.com/xmake-io/xmake/releases/download/v2.2.7/
    dir=/SCOOP/cache
    out=xmake#DL#https_github.com_xmake-io_xmake_releases_download_v2.2.7_xmake-v2.2.7.win64.zip

ERROR & '/usr/bin/aria2c' --input-file='/SCOOP/cache\xmake.txt' --user-agent='Scoop/1.0 (+http://scoop.sh/) PowerShell/6.2 (Windows NT 4.9; Core)' --allow-overwrite=true --auto-file-renaming=false --retry-wait=2 --split=5 --max-connection-per-server=5 --min-split-size=5M --console-log-level=warn --enable-color=false --no-conf=true --follow-metalink=true --metalink-preferred-protocol=https --min-tls-version=TLSv1.2 --stop-with-process=1 --continue
The expression after '&' in a pipeline element produced an object that was not valid. It must result in a command name, a script block, or a CommandInfo object.
+     & "$env:COMSPEC" /c $cmd
+ CategoryInfo          : InvalidOperation: (:String) [], RuntimeException
+ FullyQualifiedErrorId : BadExpression
 

Please try again or create a new issue by using the following link and paste your console output:
https:////
PS /> ls /SCOOP/cache/
xmake.txt
PS /> cat /SCOOP/cache/xmake.txt
https://github.com/xmake-io/xmake/releases/download/v2.2.7/xmake-v2.2.7.win64.zip
    referer=https://github.com/xmake-io/xmake/releases/download/v2.2.7/
    dir=/SCOOP/cache
    out=xmake#DL#https_github.com_xmake-io_xmake_releases_download_v2.2.7_xmake-v2.2.7.win64.zip

PR action edge case

Check what happen if there are no manifests changed. Only binaries for example

Consider parsed version number from issue title

If loaded manifest and version parsed from issue title does not match post some comment Latest version of manifest is <ver>. You reported different version. Please run scoop update and then try again.

Experiment with SSH_KEY for excavator

If repository contains protected master it will need to provide ssh key as secret.

if ($env:SSH_KEY) {
    Set-Content "$HOME\.ssh\id_rsa" $env:SSH_KEY -Encoding ASCII
} else {
    git config remote-url ... $user:$token
}

If it will work. Note, example and instructions how to add have to be added into Readme.

Autoupdate hash investigation

If there is no autoupdate.hash just test causal urls.

  1. Metalink
  2. Header
  3. Suffixes for url ($url.$_)
    1. .sha256
    2. .sha1
    3. .sha512
    4. .md5
  4. Suffixes for url without extension $baseurl/$fileNameNoExtension.$_
    1. .sha256
    2. .sha1
    3. .sha512
    4. .md5
  5. $baseurl/$_
    1. SHA256SUMS, SHA256SUMS.txt
    2. SHA512SUMS, SHA512SUMS.txt
    3. checksums.txt
    4. latest.yml
    5. ....
  6. ....

If there are any, add new status with message that autoupdate hash is possible

Exit action with nonzero codes

PR action should exit with nonzero code if there is some proble (block PR merging)

In other actions I feel comment is better than failed actions

Format manifest check for PR

Test result of (Get-content -raw $manifest.fullname) -eq ($object | ConvertToPrettyJson)

  • ConvertToPrettyJson
  • Properties order

PR context

Sanitize events folder:

  • Opened
    • Fork
    • Normal
  • Commented
    • Fork
    • Normal

More advanced license checks

  • If property exists
  • If it is valid spdx identifier
    • No? Is there URL?
- [ ] License
	- [ ] Valid SPDX Identifier
	- [ ] Invalid + URL
  • This will require adding $Indent switch to new-checklistitem function

Appveyor

  • Setup appveyor for this project
  • add proper vscode settings and editorconfig

Implement all needed checks

Issues

  1. Hash check failed
    1. & bin\checkhashes.ps1 $name -Update
    2. if git status
      1. Push (if possible)
        1. Or add label verified, package-fix-needed
      2. else
        1. Comment "Cannot reproduce"
  2. download failed
    1. [ ] extract_dir Deferred as it would need lots of work and use cases covered (#11)

PRs

opened, commented with special comment

PR Workflow could be triggered with adding label TRIGGER ...

Optimizations

It would be nice if on property could be more detailed. Report to github and wait for response

Instead of issue_comment could be issue_comment.created

Identify failed hash extraction

While running autoupdate it should be easy to match something like cannot extract hash and reflect it in final comment.

- [x] Autoupdate

- [ ] Autoupdate
	- Hash extraction failed

Pushing from action

Investigate if I can push to repository from action container with just GITHUB_TOKEN

Release

Initial version (1.0.0) will contain main functionalities for automatic responses and time savers for maintainers.

  • Hash check fails validator

  • Download failed validator

  • New manifest in PR validation

    • Hashes
    • Checkver
    • Needed properties
  • "Excavator"

    • Iterative pushing done by auto-pr
  • Polish README

    • Synchronize terminology
  • Polish posted comments before first release

  • Release and tag initial version

    • 1.0.0 tag requirements
      • Events folder
        • All events needs to be in place
      • Issue handler
        • hash check
        • download failed
          - [ ] Aria2 support
      • PR
        • Commented
          • Fork
          • Normal
        • Created
          • Fork
          • Normal
      • Excavator
  • Protect Master

    • Create also stable branch, which will be almost equal with master
      • Users will not need to look for latest version
      • This may not be even point when deployed to marketplace
        - [ ] Icon ScoopInstaller/Scoop#2261
  • Register official action to marketplace

  • Adopt in buckets

    • GenericBucket
    • JetBrains
    • Sysinternals
    • Ash258
    • Main
    • Extras
    • Internal corporate repositories
      • Ixx
      • Dxxxxxxxx
      • Pxxxxx
      • Qxxxxx
      • Ixxx

Publish to marketplace

πŸŽ‰πŸŽ‰πŸŽ‰πŸŽ‰ Button is finally available πŸŽ‰πŸŽ‰πŸŽ‰πŸŽ‰

On saturday there is need to be new release with marketplace. #32 Is good candidate for readme updates, which is pretty easy to fix

A

Download action

  • Basic implementation
  • Information about causes
  • Aria2 support

Events

Add all possible events into events folder

  • PRs.opened.json
  • PRs.fork.opened.json
  • PR.commented.json
  • Issue.commented.json
  • Issue.opened.hash.check.failed.json
  • Issue.opened.extract.dir.json
  • Issue.opened.download.json
  • Scheduled.json
  • Push.json

New-CheckList function

New generic function with support for nested objects is needed for more advanced checks.

New-CheckList {
    param([Hashtable] $Statuses)

	return New-Array # String 
}
$statuses = @{
	Alfa = $true
    Cosi = @{
		Ahoj = $true
		AhojA = $true
    }
	Broken = @{
		Hello = $false
		COSi = $true
	}
}

This object will result in:

- [x] Alfa
- [x] Cosi
	- [x] Ahoj
	- [x] AhojA
- [ ] Broken
	- [ ] Hello
	- [x] COsi

Push problems with excavator

In newer version of actions there is something wrong. It looks like that git config --global user.name $env:GITHUB_ACTOR will be needed now.

Updating ...
hub pull origin master
From https://github.com/Ash258/GithubActionsBucketForTesting
 * branch            master     -> FETCH_HEAD
Already up to date.
hub checkout master
Switched to a new branch 'master'
M	.github/workflows/issue_comment.yml
M	.github/workflows/issues.yml
M	.github/workflows/pull_request.yml
M	.github/workflows/schedule.yml
Branch 'master' set up to track remote branch 'master' from 'origin'.
Pushing updates ...
hub push origin master
fatal: could not read Username for 'https://github.com': No such device or address
^^^ Error! See above ^^^ (last command: hub push origin master)

Pull requests actions

Triggers

  • Opened PR
  • Opened PR from fork
  • Comment❓❓
    • Anyone could comment to trigger this action
    • When PR is updated, then anyone could comment something like: /verify to trigger action again
  • Cleanup Test-PRFile function
    • Export checks into own funciton with $status, $manfiestOb, $manifestGci

Checks

  1. Description
  2. License (Add note to children list, about what is wrong)
    • License property exists, but it is not valid SPDX identifier
  3. Hashes
  4. Checkver
  5. Autoupdate
  6. Install (#59)
  7. Format (#24)

Expected comment:

Thanks for contributing. Your PR did not pass requirements.

### Manifest 1

- [x] Description
- [ ] License
- [x] Hashes
- [x] Checkver
- [x] Autoupdate

### Manifest 2

- [x] Description
- [x] License
- [x] Hashes
- [x] Checkver
- [x] Autoupdate
Thanks for contributing. PR looks good.

Wait for review from human collaborators.

Implementation:

Best possible to temporary save into some hashtable:

@{name = 'Manifest1'; 'Checkver' = Passed; 'Properties': 'OK | list of failed properties'}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.