scientific-python / circleci-artifacts-redirector-action

GitHub Action to add a GitHub status link to a CircleCI artifact.
MIT License
14 stars 8 forks source link

FIX: If #32

Closed larsoner closed 1 year ago

larsoner commented 1 year ago

@asmeurer can you try this? It might work. The job title is in the context, so if I got the conditional right I think it should only run for the correct status(es).

asmeurer commented 1 year ago

This seems similar to what I tried at https://github.com/sympy/sympy/pull/23732 and https://github.com/sympy/sympy/pull/23801, but maybe I misunderstood the YAML syntax (I used "Build Docs Preview" instead of "build_docs" because that is what I named the job in my circle CI config).

larsoner commented 1 year ago

I would recommend you dump the event like we do here to see what it's actually called:

https://github.com/larsoner/circleci-artifacts-redirector-action/blob/ecc5ada864e38a28a3a1a28588d39459793bccfa/.github/workflows/status.yml#L14-L17

I don't see why it wouldn't work if you have the variable names correct. for 9eceb30 there is more than just the CircleCI job, but our actions list only shows 3 jobs (circle waiting, then running/pending, then success I think):

https://github.com/larsoner/circleci-artifacts-redirector-action/actions

This is (I think) because of the line in master:

https://github.com/larsoner/circleci-artifacts-redirector-action/blob/master/.github/workflows/status.yml#L5

larsoner commented 1 year ago

Well not 100% success on MNE-Python, but at least now they show as skipped:

Screen Shot 2022-09-12 at 6 16 15 PM
larsoner commented 1 year ago

@asmeurer you'll also want to add the conditional about the "check URL" step as it's not valid until the job completes. So if you try to check it while the job is in the "pending" state, it will fail

asmeurer commented 1 year ago

OK, well if you got it working, that's a little more promising. I'm trying it at SymPy here, but there's no way to know if it will work until that is merged and a few other CI builds on other PRs happen.

asmeurer commented 1 year ago

It didn't seem to work.

larsoner commented 1 year ago

To be clear, this is what I consider "working":

https://github.com/mne-tools/mne-python/actions

Screenshot from 2022-09-28 17-34-28

So some are at least skipped. Do you not get this using a similar output when doing something like:

https://github.com/mne-tools/mne-python/blob/b486ef18f74d22b7bdcd0cf6f0e1a8fb988d5e35/.github/workflows/circle_artifacts.yml#L4

asmeurer commented 1 year ago

This is what our actions log looks like https://github.com/sympy/sympy/actions

Screen Shot 2022-09-28 at 4 23 22 PM

(the skipped "report CI results to PR" run in that log is a different build). And this is our build file https://github.com/sympy/sympy/blob/master/.github/workflows/docs-preview.yml. The only difference I see is I renamed the build to "Build Docs Preview", so maybe I somehow messed up the reference there?

Of course, showing as skipped is better than failed, but the ideal solution would be if it didn't show up at all. I don't know if that's possible. Otherwise, the "actions" tab becomes completely useless, because the "real" builds are buried under hundreds of skipped Circle CI redirector builds.

larsoner commented 1 year ago

The only difference I see is I renamed the build to "Build Docs Preview", so maybe I somehow messed up the reference there?

I wonder if the spaces are problematic or something :disappointed:

Of course, showing as skipped is better than failed, but the ideal solution would be if it didn't show up at all. I don't know if that's possible.

It does not seem possible currently, see https://github.com/larsoner/circleci-artifacts-redirector-action/issues/27#issuecomment-1242989457

I'll merge this since it seems to work in a few places at least, as the SciPy variant implemented in https://github.com/scipy/scipy/pull/17018 seems to be working as well:

Screenshot from 2022-09-29 10-59-07