Skip to content
This repository has been archived by the owner on Sep 7, 2023. It is now read-only.

[enh] every Sunday, call utils/fetch_*.py scripts and create a PR automatically #2500

Merged
merged 2 commits into from Feb 1, 2021

Conversation

dalf
Copy link
Contributor

@dalf dalf commented Jan 24, 2021

What does this PR do?

Use https://github.com/peter-evans/create-pull-request to create a PR when there is data update.

data in https://github.com/searx/searx/tree/master/searx/data

Example PR :

  • Update searx.data dalf/searx#8
  • include .github/workflows/data-update.yml as long the file is not into the master branch
  • this PR was made before utils/fetch_languages.py update (second commit of this PR) : engines_languages.json and languages.json are committed in the wrong place.
  • if the PR is not merged, new updates are push forced in the same branch / same PR.

This PR also makes a minor update of utils/fetch_languages.py.

Why is this change important?

See #2052 (comment)

How to test this PR locally?

N/A

Author's checklist

Related issues

See #2052

@dalf dalf changed the title [enh] every monday, call utils/fetch_*.py scripts and create a PR automatically [enh] every Sunday, call utils/fetch_*.py scripts and create a PR automatically Jan 24, 2021
@return42
Copy link
Contributor

I have no experience with the git-workflows: If I merge this into the master of my fork (return42/searx) on github .. will it also create PRs on my my fork? .. I guess .. if so .. can we set a condition in the git-workflow, that the workflow is active only on repository searx/searx?

@dalf
Copy link
Contributor Author

dalf commented Jan 24, 2021

I have updated the PR: the workflow will return only if the DATA_PR_TOKEN secret is defined (without this change, the workflow runs and fails to create the PR).

DATA_PR_TOKEN is a personal access tokens.

Copy link
Contributor

@return42 return42 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM ..

OT: just a question of mine

DATA_PR_TOKEN is a personal access tokens.

Tried to find, where I can set it using https://docs.github.com/en/github/developing-online-with-codespaces/managing-encrypted-secrets-for-codespaces .. but cant find 'Codespaces' what is documented there ... do I need a special contract to set such tokens?

@dalf
Copy link
Contributor Author

dalf commented Jan 24, 2021

To get the token: your profile, Settings, Developer settings tab, Personal access tokens tab.
To set the secret: in your fork, go into Settings, then the "Secrets" tab, then the "New repository secret".

@dalf dalf requested a review from asciimoo January 24, 2021 15:24
@dalf dalf merged commit 34de715 into searx:master Feb 1, 2021
@return42
Copy link
Contributor

return42 commented Feb 8, 2021

Dump question, is this git-workflow inactive?

When I make useragents.update I got ...

modified   searx/data/useragents.json
@@ -1,8 +1,10 @@
 {
     "versions": [
+        "85.0.1",
+        "85.0",
+        "84.0.2",
         "84.0.1",
-        "84.0",
-        "83.0"
+        "84.0"
     ],
     "os": [
         "Windows NT 10.0; WOW64",

What I mean; I can't see that this PR does anything .. I'm wrong? .. Is there a place, where can we monitor the tasks from

schedule:
- cron: "37 13 * * 0"

I guess the notation is what we know from unix cron entries.. right?

@dalf
Copy link
Contributor Author

dalf commented Feb 8, 2021

It fails yesterday: https://github.com/searx/searx/actions/runs/545400665

This line

if: env.DATA_PR_TOKEN != null

should be
if: secrets.DATA_PR_TOKEN != null

@return42
Copy link
Contributor

return42 commented Feb 8, 2021

It fails yesterday

I see! ... thanks for the link .. I should have more time to learn more about git-workflows.

this line ...should be ..

If you have time do you like to fix it ..

now I see that is already used here

token: ${{ secrets.DATA_PR_TOKEN }}

@return42
Copy link
Contributor

Seems that .github/workflows/data-update.yml had another issue: https://github.com/searx/searx/actions/runs/561157462/workflow and it seems you did already fixed it 50bde93 ?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants