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

Integrating Nuclia Widget #792

Draft
wants to merge 102 commits into
base: nuclia
Choose a base branch
from
Draft

Integrating Nuclia Widget #792

wants to merge 102 commits into from

Conversation

justdaksh
Copy link

@justdaksh justdaksh commented Sep 3, 2023

CC: @stevepiercy
Here is a draft for Nuclia widget integration into training.

Some of the issues to be solved:

  • Null and Undefined results
  • Loading of widget w.r.t page and Breadcrumbs w.r.t results in Offset.

Pull request preview URL:

https://plone-training--792.org.readthedocs.build/

docs/_static/searchtester.js Outdated Show resolved Hide resolved
upload.py Show resolved Hide resolved
@stevepiercy
Copy link
Contributor

Here's that git command from Volto that builds only when docs change:

https://github.com/plone/volto/blob/master/netlify.toml#L5

@stevepiercy
Copy link
Contributor

@ebrehault
Copy link
Member

@stevepiercy my guess would be the DEPLOY_NUCLIA_URL is not set.

@ebrehault
Copy link
Member

@stevepiercy yes that was missing.
I have added the DEPLOY_NUCLIA_URL and DEPLOY_NUCLIA_TOKEN variables in this repo, it should work now.

@stevepiercy
Copy link
Contributor

Thanks @ebrehault. I was looking for them in https://github.com/plone/training/settings/variables/actions, and DEPLOY_NUCLIA_URL just showed up, but not DEPLOY_NUCLIA_TOKEN.

@stevepiercy
Copy link
Contributor

Oops, there it is! nm.

@stevepiercy
Copy link
Contributor

@ebrehault the CI still fails. It looks like the action is not picking up the value for DEPLOY_NUCLIA_URL.

https://github.com/plone/training/actions/runs/11968576684/job/33370147780#step:5:11

@stevepiercy
Copy link
Contributor

Ah, I see, it's a repo var, not a secret.

@ebrehault
Copy link
Member

Still failing, but now it is looking more like a Nuclia SDK version thing, let me check.

@stevepiercy
Copy link
Contributor

I have no clue what this failure message means.

Run CHANGED_FILES=$(git diff --name-only c0e95e9ffc38cf3450ec7a39caedaa68f7c8ecd7 b89c046e8bd1c5df4345297bc8ed35708bbc7c9b)
  CHANGED_FILES=$(git diff --name-only c0e95e9ffc38cf3450ec7a39caedaa68f7c8ecd7 b89c046e8bd1c5df4345297bc8ed35708bbc7c9b)
  echo "Changed files: $CHANGED_FILES"
  if echo "$CHANGED_FILES" | grep -q 'nuclia_sync.json'; then
    echo "::set-output name=changed::true"
  else
    echo "::set-output name=changed::false"
  fi
  shell: /usr/bin/bash -e {0}
  env:
    pythonLocation: /opt/hostedtoolcache/Python/3.10.15/x64
    PKG_CONFIG_PATH: /opt/hostedtoolcache/Python/3.10.15/x64/lib/pkgconfig
    Python_ROOT_DIR: /opt/hostedtoolcache/Python/3.10.15/x64
    Python2_ROOT_DIR: /opt/hostedtoolcache/Python/3.10.15/x64
    Python3_ROOT_DIR: /opt/hostedtoolcache/Python/3.10.15/x64
    LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.10.15/x64/lib
fatal: bad object c0e95e9ffc38cf3450ec7a39caedaa68f7c8ecd7
Error: Process completed with exit code 128.

Where do we get the git hash?

See: https://stackoverflow.com/a/11834472/2214933

@stevepiercy
Copy link
Contributor

Answering my own question.

          CHANGED_FILES=$(git diff --name-only ${{ github.event.before }} ${{ github.sha }})

Next question, are these the correct values to use? It rejected github.event.before.

@stevepiercy
Copy link
Contributor

@justdaksh where did you get github.event.before? I can't find it anywhere in the GitHub docs for events.

@justdaksh
Copy link
Author

I read about it from StackOverflow at that time, but I can't find the reference to it right now.

@stevepiercy
Copy link
Contributor

@stevepiercy
Copy link
Contributor

From a comment in that SO post, I found this:

https://github.com/actions/checkout?tab=readme-ov-file#checkout-v4:

Only a single commit is fetched by default, for the ref/SHA that triggered the workflow. Set fetch-depth: 0 to fetch all history for all branches and tags. Refer here to learn which commit $GITHUB_SHA points to for different events.

Commit incoming. We'll see.

- Set fetch-depth: 0 to fetch all history for all branches and tags
@stevepiercy
Copy link
Contributor

That seems to have done the trick.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

8 participants