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

Job-level "if" condition not evaluated correctly if job in "needs" property is skipped #491

Closed
whois-jon-peterson opened this issue May 19, 2020 · 36 comments
Labels
Service Bug Bug fix scope to the pipelines service and launch app

Comments

@whois-jon-peterson
Copy link

Describe the bug
If a job needs a prior job which has been skipped, the if condition for the dependent job may behave unexpectedly under some conditions. (unsure if condition is evaluated incorrectly or if it's not evaluated at all)

To Reproduce
Steps to reproduce the behavior:
Given a workflow such as this (where job_b needs to complete or be skipped before subsequent jobs run, but subsequent jobs don't depend upon any outputs from job_b)

on: push

jobs:
  job_a:
    runs-on: ubuntu-latest
    outputs:
      truthy_string: ${{ steps.a.outputs.always }}
      null_value: ${{ steps.b.outputs.never }}
    steps:
      - id: a
        run: echo "::set-output name=always::something"
      - id: b
        run: echo "We opt not to set any output at this time"
  job_b:
    runs-on: ubuntu-latest
    needs: job_a
    if: needs.job_a.outputs.null_value
    steps:
      - run: echo "We've ensured this job will be skipped"
  job_c:
    runs-on: ubuntu-latest
    needs: [job_a, job_b]
    if: needs.job_a.outputs.truthy_string
    steps:
      - run: echo "This won't run, even though the IF condition evaluates true."
  job_d:
    runs-on: ubuntu-latest
    needs: [job_a, job_b]
    if: always() && needs.job_a.outputs.truthy_string
    steps:
      - run: echo "This will run, even though we've only changed the condition from `true` to `true && true`"

Examining the output of this workflow, job_a will always run, job_b will always be skipped, job_c will always be skipped, and job_d will run.
The only difference between job_c and job_d is the addition of always() && to the if condition.

Expected behavior
If a job-level conditional evaluates to true, the job should run after all needs'd jobs have completed or been skipped.
Both job_c and job_d should run. The always() && should not be required for job_c, since it doesn't change the ultimate true/false result of the conditional.

OR documentation should be updated to indicate this is expected behavior. The current docks simply says of job needs (emphasis added):

Identifies any jobs that must complete successfully before this job will run. It can be a string or array of strings. If a job fails, all jobs that need it are skipped unless the jobs use a conditional statement that causes the job to continue.
This is relatively ambiguous, but the plain interpretation is that a conditional statement that evaluates to true should cause the job to continue. As seen with job_c in the sample, that isn't always the case.

Runner Version and Platform

Version of your runner?
Unsure - I'm only running via Github Actions, not using a self-hosted runner.

OS of the machine running the runner? OSX/Windows/Linux/...
Linux: ubuntu-latest

What's not working?

Jobs are being skipped even when the job-level conditional evaluates to true.

Job Log Output

Because the job is skipped entirely, there is no job-level output, even if the appropriate DEBUG secret is set.

Runner and Worker's Diagnostic Logs

As above, there is no additional output, even if the appropriate DEBUG secret is set.

@whois-jon-peterson whois-jon-peterson added the bug Something isn't working label May 19, 2020
@TingluoHuang TingluoHuang added service Service Bug Bug fix scope to the pipelines service and launch app and removed bug Something isn't working service labels Jun 8, 2020
@MetRonnie
Copy link

MetRonnie commented Jul 17, 2020

I think this meant to be a feature actually, but it's too subtle in my opinion - it left me scratching my head for an hour over why my workflow step wasn't running. From https://docs.github.com/en/actions/learn-github-actions/expressions#job-status-check-functions:

A default status check of success() is applied unless you include one of these functions.

I would have expected the default value of if: success() to be replaced with if: <your_condition>, but it's actually if: success() && <your_condition> unless your condition includes one of the status functions

@t0rr3sp3dr0
Copy link

This problem is still present on version 2.273.1

@obermillerk
Copy link

Stumbled upon this while looking for a different issue, but thought I'd throw in my perspective on the matter.

needs implies a dependent relationship, so if one of the jobs doesn't run (job_b in this case) then logically it seems to me the dependent job should not run either by default, lest there be something missing from job_b's non-existent run. The fact that you can override this behavior by adding the always() check seems like a good feature; you have to explicitly say "This job does not directly depend on the previous job(s) success". I would not call the reported behavior a problem.

The only thing I think would be appropriate and appreciated is a note about this functionality in the docs for the workflow job if field (ie here) noting the relationship between if and needs, and potentially also with the job status check functions. There's a lot of areas in the docs I find where connections like this are completely overlooked, which makes it hard to get up to speed.

@martinpitt

This comment has been minimized.

peternewman added a commit to codespell-project/actions-codespell that referenced this issue Feb 2, 2021
larsoner pushed a commit to codespell-project/actions-codespell that referenced this issue Feb 2, 2021
* Only run bats diagnostics on failure

* Try a different failure syntax

* Third time lucky?

* Always run if we failed, even though the previous step failed

As per actions/runner#491

* Try and fix the logic again

* Simplify the testing

* Try a different way of checking for failure

* Try matching on any status, is matrix confusing things?

* Drop the matrix for now

* Fix the workflow syntax

* Different variable name

* Undo the hacking, matrix the bats tests

* Actually run bats if we need to

* Undo the deliberate test breakage
alcarney added a commit to alcarney/esbonio that referenced this issue Apr 25, 2021
According to actions/runner#491 we need to include an `always()` so that
the if statement is evaluated even when one of the needed jobs is
skipped.
alcarney added a commit to swyddfa/esbonio that referenced this issue Apr 25, 2021
* Update vscode-languageclient to v7.0.0
* Fix build triggers

  According to actions/runner#491 we need to include an `always()` so that
  if statements evaluate to `true` even when one of the needed jobs is skipped.
@holm
Copy link

holm commented May 22, 2021

This also had me scratching my head for a very long time. It's completely counter-intuitive you have to use any of the status functions. Maybe this is from before the outcome and conclusion status fields were available?

It would hope this requirement can be removed, because it just doesn't really make any sense. Why does one have to do if: ${{always() && ....}} to make things work?

@obermillerk
Copy link

I think the issue is that needs is the only way to sequence jobs within a workflow and this gives rise to two groups of use cases: the ones where people are using it just to sequence their jobs, and the ones using it for it's intended purpose of creating a dependent relationship.

Those in the first category feel it is illogical because they are using it simply to order their jobs, while those using it for the original intended purpose I would guess generally find it makes sense. A job that needs another job shouldn't run if that other job doesn't, it would likely be broken because of the dependent relationship between the two.

Perhaps some other form of sequencing should be introduced to alleviate this confusion, or as I suggested in my last comment just making this much more clear in the docs could probably do the same work.

@andreykaipov
Copy link

andreykaipov commented May 29, 2021

In a similar case, I had a conditional job Z I wanted to run at the end of all other jobs A, B, C. However, when any of A, B, or C were skipped, my Z job also got skipped. Adding always() did make it run, but even when the previous jobs failed, so I had to also check the results of my previous jobs:

jobs:
  ...
  Z:
    runs-on: ubuntu-latest
    needs: [A, B, C]
    if: |
      always() &&
      (needs.A.result == 'success' || needs.A.result == 'skipped') &&
      (needs.B.result == 'success' || needs.B.result == 'skipped') &&
      (needs.C.result == 'success' || needs.C.result == 'skipped') &&
      my_original_conditional()
    steps:
    - name: blah
      ...

Very verbose and I'm probably not using workflows as intended, but it works! 😅

@gad2103
Copy link

gad2103 commented Jul 19, 2021

i also find this behavior burdensome and confusing. for example:

---
name: Test

on:
  - pull_request
  - push

jobs:
  jobA:
    name: This will always runs (JobA)
    runs-on: ubuntu-latest
    steps:
      - run: echo jobA
    outputs:
      runs: ${{ true }}

  jobB:
    name: This will be always skipped (JobB)
    needs:
      - jobA
    if: ${{ false }} 
    runs-on: ubuntu-latest
    steps:
      - run: env

  jobC:
    name: This will always run (JobC)
    needs: [jobA, jobB]
    if: always()
    runs-on: ubuntu-latest
    steps:
      - run: echo world
    outputs:
      runs: ${{ true }}

  jobD: # THIS DOESN'T RUN BECUASE IT JUST DEPENDS ON JOB C
    name: This should run if jobC runs (JobD)
    needs: [jobC]
    runs-on: ubuntu-latest
    steps:
      - run: env

  jobE:
    name: This should run if jobD runs (jobE)
    runs-on: ubuntu-latest
    needs:
      - jobD
    steps:
      - run: env

my expectation from working with DAG based systems is that a parent node should determine a child node directly. why does a child node have to know about grandparents in order to execute a task that depends ONLY ON THE PARENT running? can't see the logic here..

@PaulRBerg
Copy link

PaulRBerg commented Aug 17, 2021

Idea 💡

What if there was a new field called follows (or trails or runs-after), which would would behave like this?

  1. Job C lists job A and job B under follows.
  2. Job A and job B run.
  3. If both A and B were either executed successfully or skipped, run C as well.
  4. If either A or B failed, do not run C.

This would be effectively equivalent to @andreykaipov's solution, but less verbose. Example:

jobs:
  ...
  C:
    runs-on: ubuntu-latest
    follows: [A, B]
    if: my_original_conditional()
    steps:
    - name: blah
      ...

@gad2103
Copy link

gad2103 commented Aug 17, 2021

@PaulRBerg do you understand the reasoning behind why needs shouldn't just behave the way we're expecting it to? I'm all for adding a new keyword if it makes sense to preserve the functionality of the original one, but here it seems to me like needs should just always reference the node closest to it in the DAG and the DAG builder should be able to resolve chained dependencies.

I'm trying to think of if needs was built this way to prevent cycles but not coming up with anything that this specific setup ameliorates.

I'm happy to be shown the light though...

@mkungla
Copy link

mkungla commented Aug 27, 2021

I think following example will produce expected behavior of original question.

job_d:
  runs-on: ubuntu-latest
  needs: [job_a, job_b]
  if: |
    always() &&
    !contains(needs.*.result, 'failure') &&
    !contains(needs.*.result, 'cancelled') &&
    needs.job_a.outputs.truthy_string
  steps:
    - run: echo "${{ toJSON(needs) }}"

@obermillerk
Copy link

@gad2103 I think you're arguing a different issue here. This issue is about needs causing jobs not to run if any of the needs jobs are skipped. While I agree with your point that you shouldn't need to include grandparents in needs (if that is actually the case, doesn't seem like it should be), I think your complaint belongs in a separate issue.

nyxnor added a commit to nyxnor/usability-misc that referenced this issue Mar 31, 2023
Not working, build is being skipped.
Related: actions/runner#491
@DrummerB
Copy link

In a similar case, I had a conditional job Z I wanted to run at the end of all other jobs A, B, C. However, when any of A, B, or C were skipped, my Z job also got skipped. Adding always() did make it run, but even when the previous jobs failed, so I had to also check the results of my previous jobs:

jobs:
  ...
  Z:
    runs-on: ubuntu-latest
    needs: [A, B, C]
    if: |
      always() &&
      (needs.A.result == 'success' || needs.A.result == 'skipped') &&
      (needs.B.result == 'success' || needs.B.result == 'skipped') &&
      (needs.C.result == 'success' || needs.C.result == 'skipped') &&
      my_original_conditional()
    steps:
    - name: blah
      ...

Very verbose and I'm probably not using workflows as intended, but it works! 😅

I believe the same result can be achieved like this:

jobs:
  ...
  Z:
    runs-on: ubuntu-latest
    needs: [A, B, C]
    if: always() && !cancelled() && !failure() && my_original_conditional()
    steps:
    - name: blah
      ...

Essentially, we would need a condition success() || skipped() but skipped() is the only state check that does not exist for some reason. However, we can get the same result by starting with always() and removing all other conditions.

I am not 100% sure this works exactly the same in more complex setups with multiple levels of dependencies, but during my testing it seemed to work.

t3chguy added a commit to element-hq/element-desktop that referenced this issue Aug 2, 2023
ivolcov added a commit to extenda/shared-workflows that referenced this issue Jan 17, 2024
Additional adjustment needed in order to prevent actions/runner#491
ivolcov added a commit to extenda/shared-workflows that referenced this issue Jan 17, 2024
* fix(MCPE-3498): Adjust job conditions

Additional adjustment needed in order to prevent actions/runner#491

* fix(MCPE-3498): Clean-up
kinyoklion added a commit to launchdarkly/js-core that referenced this issue Sep 3, 2024
This contains several conditions that appear to be illogical, but are
required by github actions. For some background this issue can be read:
actions/runner#491

`always()`:

Imagine two packages. Package "a" and package "b".

"b" depends on "a" and we want to automatically release "a" and "b"
using release please. We make "b" `needs` "a", so that "b" will build
after "a". But if we do that, then "b" will not build unless "a" also
builds. We often need to release "b" even though there are no changes to
"a".

By using `if: always()` we can cause "b" to run after "a" even when "a"
doesn't run.

`failure()` and `canceled()`.

With `always()` package "b" will be built and released even if package
"a" failed to build. You would expect that to only require `failure()`,
but it seems that it only works if you have `canceled()` as well. (It
may be we don't actually need failure.)

We want the build order to be like this.
![dep-order-2
drawio](https://github.com/user-attachments/assets/7d499cdb-1163-442b-aefa-7bac01ad560b)
vincerubinetti added a commit to greenelab/lab-website-template that referenced this issue Oct 28, 2024
Closes #272 
Closes #269 
Closes #191  (hopefully)

New template version checklist:

- [x] I have updated CITATION and CHANGELOG as appropriate.
- [x] I have updated lab-website-template-docs as appropriate. Pending
change request:
https://greene-lab.gitbook.io/lab-website-template-docs/~/changes/a57wjuxagDtJUR241kyt/basics/components/list
- [x] I have checked the testbed as appropriate.

---

- use `name` field for all debug/logging steps in workflows
- use `jwalton/gh-find-current-pr` to get PR number to be more reliable
(in rare cases, `github.event.number` can be empty)
- fix bug in "first time setup" workflow where `description` gets
appended to `user` due to missing `\n` in printf
- rename workflows from `.yml` to `.yaml` for consistency
- remove useless "build preview" workflow run in "on schedule" †
- dont run "update citations" workflow on PR close, which should
hopefully avoid issues discussed in #191. in my testing on a fork
(vincerubinetti/lab-website-template), it does. need to use step-level
`if` skipping instead of job-level or workflow-level because of [this
issue](actions/runner#491 (comment)).
- when "on schedule" workflow opens a PR, add hint in body of the PR on
how to trigger the live preview workflow
- use the `xml_escape` liquid filter wherever a user/third-party
provided field is used in an HTML attribute to prevent special
characters breaking HTML rendering. example: `aria-label="{{
citation.title }}"` and `citation.title` is `"Lorem Ipsum" dataset`,
causing attribute to prematurely close.
- change `data_filter` to accept Ruby expressions instead of custom
syntax. use Ruby `eval` and define each field in the item as a local
variable, e.g. `{"animal": "cat"}` lets you use `filter="animal ==
'cat'"`.
- fix heading anchor styles
- add styles for `<details>` element
- fix logo shrinking/growing css bugs

† due to a [github
limitation](https://github.com/peter-evans/create-pull-request/blob/main/docs/concepts-guidelines.md#triggering-further-workflow-runs),
it wouldn't not run anyway on the auto-created PR. the user must
close/reopen the PR, then the regular "on pr" workflow (which includes
running "build preview") will run. i've already [updated the docs to
talk about
this](https://greene-lab.gitbook.io/lab-website-template-docs/basics/citations#periodic-updates).
from now on, let's treat auto-opening PR as the only supported way.
previously i considered that the user could change `open-pr` to `false`
to have "on schedule" commit updated citations directly to `main`, but
let's nix that to maintain simplicity. it's probably better that we
force the user to review the changes before pushing them to their live
site anyway. if we did want to support that in the future, the "build
preview" run i removed would have to be changed to a "build site", since
we'd want to be re-building the `main` branch version of the site, not a
preview for a PR.

---------

Co-authored-by: Faisal Alquaddoomi <[email protected]>
matthuska added a commit to mf1-btr/mf1-btr.github.io that referenced this issue Nov 29, 2024
* Initial commit

* update readme

* Add files via upload

* Update README.md

* Update README.md

* update readme

* update readme and init jekyll

* add header, footer, plugins, and more

* convert absolute_url to relative_url

* add section background, refactor repo organization

* convert css to sass, add more components

* add code, table, and other components

* fix anchors, other tweaks

* update readme

* update readme

* update readme

* update readme

* update readme

* add cards, container, rearrange index, and more

* add tags, add mobile styles to small card

* add contact page, tweak css

* add social link, role, and portrait components

* add blog and more

* add readme contents section, add icons, add 404

* update readme, add tags to blog posts

* update readme

* update readme

* update readme

* update readme

* update readme

* update readme

* update readme

* update readme

* add embeds and update readme

* update readme

* update readme

* add member pages, tweak css, more

* add rss, basic team, and more

* member list and more

* add resources list

* add basic research page

* add search, update readme, and more

* update readme

* update readme

* update readme

* update readme

* update readme and more

* update readme

* update EndBug/add-and-commit to version 5

* update research gh-actions

* update readme

* Update build-research.py

* change actions commit step and update readme

* update readme

* update readme

* update readme

* Update README.md

* various fixes (#14)

- fixes bug in paper date sorting by modifying python build script to pad month and day with leading `0`'s if they don't exist
- add new paper to research-input to test date sorting
- simplified blog-list component and added section breaks
- simplified css for card search component
- get rid of "smart" section breaking and instead make it explicit. user must specify where section breaks go
- add flat option for figure component
- simplify research-list component a bit
- change tag component to accept comma separated string, to allow for spaces in tags
- add section breaks and empty row checks to blog post layout
- various css tweaks
- fix css bug where `hide` style was not being respected and thus card search filtering was not working
- update index.md to reflect new behavior
- fix anchors plugin to only get headings with ids
- fix anchors plugin to only move id to parent section if the heading is the first child of the section (this is due to the simplification of the section breaks)
- update card search plugin to reflect new class names of component

* minor CSS tweaks and anchors plugin fix

* remove end section break from blog list component

* css tweaks and add mini option to team list component

* Update README.md

* Update index.md

* update readme and index docs

* tweak heading css

* Update research-input.yml

* Update research-input.yml

* Update research-input.yml

* Update blog-list.html

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update content.html

* Update post-nav.html

* Update logo.svg

* Update header.scss

* Update template based on new wiki documentation (#21)

- `/icons` -> `/favicons`
- `heading` -> `title` in `feature` component
- `type` -> `group` in `resource-list` component and `resources.yml`
- remove `order` in `team-list` component (until someone requests this)
- remove `placeholder` parameter from includes
- delete `/_data/team-order.yml`
- add quote block styles
- delete comments in `/_data/research-input.yml`, `/_data/resources.yml`, `/_includes/header.html`
- delete/reduce images
- reduce readme to barebones, and refer to wiki for documentation
- add license file

* Update README.md

* rewrite build script (#23)

- add more comments (but remove comments at top of file that are already covered in the wiki documentation)
- refactor code to < 80 char wide
- load yaml with line numbers
- add log and exit funcs with color for easier visual identification
- add check for input file
- add specific catch/errors for opening and parsing input yaml
- add check that top level of input yaml is array
- add error flag
- add single default date
- log input yaml line number along with "paper X of N" for much easier troubleshooting
- log doi/id
- add check that paper is object
- add check that paper has id field
- add check that paper is not a duplicate
- add check that existing output papers are lists of dicts
- add catch/error to manubot command
- make field extraction from manubot citation more robust
- add catch/error for formatting dates
- add check for writing output file
- add "done" or "done with errors"
- removes markdown support in card components (and resource list component) to fix #24
- add lazy-loading to images so research page with 100s of papers doesn't take forever to load
- disables card search box until associated javascript has finished loading

* update gh-actions workflow

* componentize nav links

* refresh logo

* Minor grammar suggestions (#38)

Two incredibly minor suggestions to fix:
1. dangling modifier
2. extraneous comma

* make simplifications and additions inspired by tislab website (#35)

- add pull request template
- (hopefully) fix prevent automatic citations when research output has been touched (already built or edited by the user)
- rename automatic citations script, and in general, make the terminology surrounding "research" and "automatic citations" more clear and consistent
- add screenshot of template to readme
- move front matter defaults for description and background to top of config file as setting
- add logo, header, and footer image as config file setting
- add nav bar links as config file setting (removes the need to edit the header component directly)
- rename google to google-scholar for clarity
- add warning to top of research output not to edit
- rename `.yml` to `.yaml` in accordance with YAML recommendation and best practice
- add banner component which simply shows an image at full page width, for use with full sections
- add option to big-link component to look like a big button
- remove line-wrapping from (make a single line) the root html element of every component to avoid markdown parsing issues
- rename centerer component "html" parameter to "contents" for clarity
- add ability to make full width sections, dark sections, and sections with backgrounds with special `<!-- section ___ -->`-like keywords
- add LinkedIn
- remove need to edit footer manually to add desired social media icons. instead, footer can show all platforms, but only shows ones that are specified in the config settings for the site-wide social media accounts
- change logo to config setting and simple `<img>` tag (removes need to edit header file manually to add logo)
- refactor social-link component a bit. don't show if link not provided. this way, layouts and components in the template can simply list all social types, and the ones that aren't provided on that page won't display, no need to "if statement" them all
- remove build and start scripts, as i'm the only one who will likely use them
- many CSS changes and tweaks. namely, import all material design colors for users to use
- add full section and banner component to home page as example
- add dark and bg section to team page as example

* add data and collection fallbacks, rename variations to aliases

* fix post info regression

* fix file names, remove workflow filter that doesn't work

* Rewrite automatic citations script (#39)

- rewrite automatic citations script in response to greenelab/greenelab.com#35
    - rename variables for clarity
    - in general, simplify and refactor
    - remove some util functions
    - make yaml structure and missing id fields critical errors
    - make manubot fail as critical error
    - match output to input by id rather than index
    - write warning to top of output file
- add force push option to hopefully fix and close #30
- remove RSS as social media icon. leave just the meta tag tag can be detected by browser extensions. if some RSS users complain that they need a clickable link to the RSS feed file to subscribe (maybe their RSS client/extension can't detect the meta tag?), we can always add it in again easily

* Header/footer, feature, and figure fixes (#47)

- fix feature title/heading parameter bug
- rework figure sizing parameters to hopefully be more robust and cleaner
- allow "none" for site-wide config header/footer settings
- add `header/footer-dark: false` option for page and site settings to control header footer background solid color in addition to image
- move background styles from section to background sass file
- make card medium size same image aspect ratio as large size
- style feature image in terms of page width
- make feature image natural height and fixed width
- other small changes

* minor changes

* update google fonts, make font weight palette, make new palettes style file

* remove flat options

* add facebook social link

* remove large option from social link component

* remove spaced option from centerer component

* css tweaks

* remove vestigial role component large option

* improve figure sizing logic

* figure svg sizing fix

* fix background dark only bug

* make header icons darker, refactor icon styles

* Refactor (#60)


- make language in gh-actions workflow more declarative and simple
- install usefull jekyll plugins and go through entire list of gh-pages supported plugins to determine usefullness
- install eventmachine to (hopefully) permanently fix livereload on windows
- reorganize `config.yaml`. move nav options to `.md` files themselves. put social links under object for easy/clear iteration
- rename `title` params to `name` wherever possible to reduce confusion/collision with `page.title`
- combine several separate components into single link component with text and/or icon
- abstract link and role types into separate yaml files for easier user-editing
- split card component into card component and separate citation component
- get rid of centerer component and opt for simpler CSS
- make citation component that can read from `citations.yaml` to display a single citation, or be used with list component to display all research
- indent and trim liquid syntax wherever possible for easier reading and cleaner output
- for footer, loop through site links rather than explicitly list
- instead of specific `research-list`, `blog-list`, etc. components, make generic list component that can iterate through an arbitrary list of data, filter it, and display it with any component
- add orcid to social link options
- refactor portrait component and add option for title/position
- loop through CSS and JS includes rather than listing individually. now you can just add a CSS or JS file to their respective folders and it will be included automatically
- add clickable tags
- refactor tooltip and add arrow
- put member social links under link object for easier iteration
- update naming in auto-citation script for clearer distinction of terms. "sources" now means the input, and "citations" now means the output. previously these were "papers" and "output papers", but a thing being cited isn't always going to be a paper, thus the more general naming
- change contact page to nicer buttons
- various css improvements
- make section component instead of section breaks and properties being in HTML comments
- fetch-tags script improvements. emit event when done
- major enhancement to search plugin. allow tag searching, refactor to cleaner code, add clear button to search box, etc
- remove dummy functions/classes for case where third party plugins can't load (eg no internet access), and put checks in plugins themselves
- refactor/redesign post-info and role components
- implement "true hide" script to help CSS behave properly and look nicer when certain elements are hidden

* fix gemfile with jekyll plugins

* remove eventmachine from gemfile

* set theme to null

* fix gh-pages build error

* fixes after refactor (#63)

- make list component display list in given order when not grouped by date
- make card "small" style smaller
- fix critical bug in citation component due to `github-pages` gem being installed
- fix gallery component, add "square" style option
- fix role component text variable scope issue

* add analytics placeholder, polish list styles

* tweak portrait and gallery design

* tweak portrait styles

* improve 404 page and small input/search tweaks

* avoid jekyll's broken 'find' filter to fix citations

* fix search box css

* Update links.yaml to fix github tooltip (#64)

* refactor auto-cite to plugin architecture, add orcid plugin (#70)

- complete overhaul of auto-cite architecture
- move auto-cite and related files to dedicated `scripts` folder
- add `__pycache__` to gitignore
- improve logging clarity
- make plugin architecture. plugins take list data from one yaml file at a time, and return a list of sources.
- make config.yaml for plugin order and input files. you can now split up input sources into separate files. example: you have `2019-papers.yaml` `2020-papers.yaml` `2021-papers.yaml` that get processed by the normal `sources` plugin, and `current-orcid.yaml` `alumni-orcid.yaml` that get processed by the `orcid` plugin
- orcid plugin copies over any metadata to each source it returns, which can be used for filtering. example: `- orcid: 09182-12398-912837-129387 page: alex-lee` will return a bunch of papers for that orcid, and each paper will have the field `page` set to `alex-lee`. then that field can be used as a filter in the list component

* close a few small issues (#74)

- fix tooltip bug on safari?
- make the components that look up their info by id more robust by moving variable assignments closer to their use location to avoid variable scoping issues
- filter blank sections and remove unnecessary `break` option in section component
- add ability for list component to read numerical filter values in addition to just strings
- add ability for portrait and post excerpts to look up team member and blog post by id instead of filling out params manually
- add generic two column component
- update documentation for the above

* rename scripts folder to auto-cite, update readme auto-cite docs link

* revert autocite plugin order

* remove orcid input and plugin run

* move auto-cite config to main config, fix tooltip (#79)

- set tooltip display to none after it fades out to avoid potential layout issues
- move auto-cite configuration from its own separate config file to the main site config, to be less confusing
- make citations component get the location of the auto-cite output citations from the config file, rather than being hard-coded to "citations.yaml"

* Create CITATION.cff (#91)

* update pull request template to include warning about forks and gh-actions

* Remove specified body font size for accessibility

* Accessibility, bug, performance, and misc fixes (#103)


- take site-wide google search on 404 page and make it into reusable component (see #2)
- remove gallery from readme (since we'll be want to update it somewhat regularly) and move to wiki
- set `img` alt attributes as appropriate
- refactor sections to be only one html element
- load font awesome async for performance
- add spots for extra details in footer, and add ad for template
- move some basic items in head to meta
- turn logo-text config option into simple boolean
- fix small blog post excerpt bug
- defer load all scripts
- move from popper.js to tippy.js for tooltips
- add accessible label to search box
- make tags component accept list or comma-separated values more robustly
- fix two col component bug where it can't accept markdown
- add html doctype and lang to prevent warnings and various issues
- remove bash scripts that no-one should probably be using, and are documented in the wiki anyway
- various css tweaks
- add aria labels to anchors
- fix anchor move-to-parent bug
- on team page, replace dead link to non-existent join page with just some job positing filler details (see #86 for discussion)
- test each page with lighthouse (in chrome dev tools), mobile and desktop

* Tag fixes (#106)


- add webrick for ruby 3.0.0+ support
- add example tags to tools
- remove flex sass mixin
- misc css fixes
- make use of flex gap where appropriate
- 0.9rem for certain sans texts
- fix search box button color to make visible
- add active color to tags
- dedup and add tooltip to tags when fetched from github
- refactor search script, rename "query" to (CSS) "selector" for less confusion, update url from search box and clear buttons
- add clear search link to search info component
- add util script file, including func to normalize strings for comparisons, and debounce func

* add subtitle option, tooltip tweaks

* Update .gitignore

* add flip behavior to button and feature

* rename name/headline to title, add subtitle to card, misc fixes

* fix card tags logic

* add boolean support to list filters

* fix blank tooltips

* minor tweaks

* misc css and js fixes (#109)

- simplify css to replace margin with flex gap where possible/appropriate. more simple and robust against direction changes, wrapping, new elements/rows/cols.
- fix regression with feature component when flipped and on small screen
- change "smart" behavior of `search-info`. show/hide based on whether anything searched, not whether anything filtered. more intuitive/expected and simpler. (there can be searches that don't filter anything because every item matches).

* make portrait name text smaller

* update font awesome version to 6

* update font awesome to v6

* add clearer note to auto-generated citations file

* fix generated warning note in citations file

* Update pull_request_template.md

* tweak manubot log level (#113)

- increase manubot log level to "warning" to show message when an invalid identifier type is used
- force manubot logging to gray color
- rearrange `try` blocks around manubot call for a bit better distinction between errors
- make trueHide/trueShow util funcs just be locally `<script>` scoped (like the other util functions) rather than attached to `window`

* Improve auto-cite process (#120)


- change auto-cite github actions workflow to install via requirements.txt (allows us to add more packages later if we need)
- update CFF file
- rebuild demo citations with new cache key
- add explicit cache matching key to sources. do this as a hash of the input source object. so, when any field in the source changes, invalidate the cache. just to be safe and for simpler/less error-prone behavior.
- add special case for when `id` is not defined. in this case, do not pass to manubot (because it will throw error), and instead pass source through untouched.
- move the code that merges in extra/overridden input props into the sources loop to avoid another "match by id" situation" (error prone)  
- force pyyaml to not use references (shows up when there are duplicate data structures)
- rename "find_match" to "get_cached". match by explicit cache key instead of id. if key absent, do not count as match. if more than one match, do not count as match (needed because if there are multiple sources with the same id in the same file, but with different other props, the template could choose the wrong one and screw up the output).
- add requirements.txt
- reformat all python with black formatter
- updated docs to reflect the above.

* update citation component to support id-less (#122)

* add shield to readme

* use page.name instead of .title for members

* fix bug from previous page.name hot fix

* in doc title, move page title in front of site title

* Don't error exit code on metasource failure, and misc error handling improvements (#127)

- temporarily track which plugin source came from with `_plugin` and `_input`, then ignore `exit()` when it is a metasource to address #121. delete these keys before exporting.
- better error catching for various error-prone points
- make logging and `.get()` fallbacks better
- make `exit()`s happen at end of loop with `will_exit` flags, instead of stopping in the middle so users can see all entries that cause problems at once
- rerun auto-cite and regenerate cache keys due to renaming of internal `_plugin` and `_input` keys
- change "message" in exception catching to "e" to match convention
- update docs to reflect above

* update auto-cite workflow (#128)

- add the ability to run auto-cite workflow periodically, or on demand (through the github website interface), but comment out
- increase timeout for auto-cite workflow
- better citation date handling and fallbacks
- truncate non-rich citation authors

* Update link.scss

* Update theme.scss

* Update palettes.scss

* Update palettes.scss

* fix citation component lookup bug

* fix code css, add rounded var to theme

* add new font awesome class names, tweak rule css

* citation and portrait css tweaks

* change google scholar to user id

* update google scholar link pattern

* update member paper button to be clearer

* fix code block and two-col css

* First official version (#159)

greenelab/lab-website-template#159

* v1.1.0 (#166)

* v1.1.1 (#174)

See changelog for high level, user-facing changes.

- docker python install changes. pin watchdog version, turn off unneeded
caching.
- docker entrypoint changes. run cite process immediately, ensure no
simultaneous runs.
- first time setup fixes. don't parse config.yaml as yaml, instead
customize with string replacement to preserve key order and comments.
- add title and link fallbacks to citation component
- fix start/end markers for blog post excerpts, and remove special
characters from hidden search attribute
- change member page from col layout to float
- add multi-line option to regex_scan liquid plugin (to support
start/end marker bug above)
- add new regex_strip liquid plugin to strip all special characters from
string
- card, code, portrait, post excerpt css fixes
- fix testbed image links
- (re)include user pr template
- fix versioning workflow to correctly parse and split changelog
- add show-title and show-subtitle site config options
- include site subtitle in description meta tag

* v1.1.2 (#178)

See greenelab/lab-website-template#177 .
v1.1.1 introduced a regression in `first-time-setup.yaml` when clearing
the `gh-pages` branch. I wanted to make the command simpler -- to simply
delete everything in the folder -- but I didn't think it through enough.
[There is a safeguard to prevent the command from
working](https://unix.stackexchange.com/questions/369530/rm-refusing-to-remove-or-directory-skipping),
and also even if it did work it would delete the `.git` folder which
would break things. Thus, this version reverts the command to how it was
before, manually specifying each `.` folder.

* v1.1.3 (#185)

Closes #181 and #180 
Closes #179 

- fix typo in first-time-setup.yaml
- fix versioning workflow tag/release
- tweak some cite.py and _plugins comments
- add commented out `continue` for if user wants to discard sources that
have ids that can't be cited by Manubot, per #186 discussion
- clean Manubot title/authors/publisher/etc output. trim whitespace and
filter.
- fix citation, portrait, and float css

The tagging/releasing step is now reverted to [how I had it in
v1.1.0](https://github.com/greenelab/lab-website-template/pull/166/files#diff-67cc7f4d3d06063e6239e59de699c4a2c768ba544777ded6aa22ab45aa0ad24a),
just using `ncipollo/release-action` for both the tag and the release,
and removing `mathieudutour/github-tag-action`. Idk why I keep going
back and forth. I guess the last time I tried using just `ncipollo` it
didn't work? But it seems to be working now (links ephemeral):

https://github.com/vincerubinetti/lwt-test/pull/2
https://github.com/vincerubinetti/lwt-test/releases/tag/v1.1.4

---------

Co-authored-by: vincerubinetti <[email protected]>

* v1.1.4 (#192)

- explicitly list cite process cache files in gitignore
- add default values for all `.get()` calls for extra safety and also to
indicate expected type
- change `id` to `_id` in plugins. this was done in the main `cite.py`
script in v1.1.1 but i missed it in the plugins.
- fix dangerous memoize/cache bug where cache key doesn't include the id
of the metasource currently being cited, which affects the output
- orcid plugin: update api to v3
- orcid plugin: fix bug where all ids for single source were being
included. instead, find most recent doi, and fallback to other id type
if not available.
- orcid plugin: keep a few details from api for ids that aren't citable
by manubot
- allow `format_date` util func to accept numeric timestamp (returned
from orcid api)
- tweak member bio page

* v1.1.5 Fix orcid plugin attributeerror bug (#198)

- various cite process tweaks
- add traceback logging of running plugins
- change variable names for clarity and consistency
- add generic "safe get" function as suggested by Faisal last pr
- use generic safe get in place all of all gets. helps fix bug due to
orcid api sometimes returning none types for certain fields, and other future bugs.

* v1.1.6 unpin python packages (#212)

Unpins all cite process python packages from their exact versions, pins
them to **major versions**. This ensures users will be on the latest
versions of packages, without breaking changes (assuming the packages
follow semver properly), and without having to constantly update their
template version (which can be a pain).

Closes #210 
Addresses #211 

FOR THE TEMPLATE MAINTAINER(S)

New template version checklist:

- [x] I have updated CITATION and CHANGELOG as appropriate.
- [x] I have updated lab-website-template-docs as appropriate.
- [x] I have checked the testbed as appropriate.

---------

Co-authored-by: vincerubinetti <[email protected]>

* V1.2.0 (#244)

- add discussion templates. be more aggressive requiring fields.
- update to latest version of all github actions (checking for breaking
changes)
- add debug step to each workflow to allow ssh access in
- fix site.location vs page.url bug (see issue)
- add html-proofer plugin to check for broken images and links, disabled
by default because it adds a lot of time to hot-reload, but set
explicitly as false in config so users can easily flip it on
- update bundler version and re-bundle gems
- add "remove" option for cite-process that allows a user to remove a
source from a metasource. e.g., an ORCID returns a source that the user
doesn't want on their site, so in their sources.yaml they put the id and
remove: true.
- by default, ignore sources that manubot can't cite if they're from
metasources (see changelog)
- add markdownify to more component params
- fix bug in citation (and other) components where when lookup is blank,
first entry in list is always chosen
- make use of newly widely available CSS container queries
- remove compilation-time wrapping of tables because it breaks nested
tables, and is not (practically) possible to support them in the same
way. replace with run-time js plugin for wrapping.
- upgrade font awesome and improve loading mechanism
- fix header title/subtitle CSS bug reported by @Maruuka 
- add "image" param to post excerpt component, so blog posts can have
thumbnails
- fix bug that prevents manual passing of tags to tag component
- add heading 5/6 styles/support
- tweak dark mode plugin
- various style tweaks

New template version checklist:

- [x] I have updated CITATION and CHANGELOG as appropriate.
- [x] I have updated lab-website-template-docs as appropriate.
- [x] I have checked the testbed as appropriate.
- [x] I have tested changed workflows on a freshly generated and forked
repo.

* V1.2.1 (#247)

- fix bug where literal yaml date object doesn't get parsed correctly
- fixes addition of site.url by gh-actions workflow

New template version checklist:

- [x] I have updated CITATION and CHANGELOG as appropriate.
- [x] I have updated lab-website-template-docs as appropriate.
- [x] I have checked the testbed as appropriate.

* v1.2.2 (#257)

Closes #250 
Closes #256 
Closes #260 
Closes #258

- adds `affiliation` to member portrait component
- simplify portrait component code/css
- make tag de-dupe behavior the same as search de-dupe. normalize to
lower-kebab-case.
- expand list of manubot-supported id types for falling back to orcid
api details
- change order and type of preferred ids from orcid

---------

Co-authored-by: Faisal Alquaddoomi <[email protected]>
Co-authored-by: vincerubinetti <[email protected]>

* v1.3.0 (#274)

Closes #272 
Closes #269 
Closes #191  (hopefully)

New template version checklist:

- [x] I have updated CITATION and CHANGELOG as appropriate.
- [x] I have updated lab-website-template-docs as appropriate. Pending
change request:
https://greene-lab.gitbook.io/lab-website-template-docs/~/changes/a57wjuxagDtJUR241kyt/basics/components/list
- [x] I have checked the testbed as appropriate.

---

- use `name` field for all debug/logging steps in workflows
- use `jwalton/gh-find-current-pr` to get PR number to be more reliable
(in rare cases, `github.event.number` can be empty)
- fix bug in "first time setup" workflow where `description` gets
appended to `user` due to missing `\n` in printf
- rename workflows from `.yml` to `.yaml` for consistency
- remove useless "build preview" workflow run in "on schedule" †
- dont run "update citations" workflow on PR close, which should
hopefully avoid issues discussed in #191. in my testing on a fork
(vincerubinetti/lab-website-template), it does. need to use step-level
`if` skipping instead of job-level or workflow-level because of [this
issue](actions/runner#491 (comment)).
- when "on schedule" workflow opens a PR, add hint in body of the PR on
how to trigger the live preview workflow
- use the `xml_escape` liquid filter wherever a user/third-party
provided field is used in an HTML attribute to prevent special
characters breaking HTML rendering. example: `aria-label="{{
citation.title }}"` and `citation.title` is `"Lorem Ipsum" dataset`,
causing attribute to prematurely close.
- change `data_filter` to accept Ruby expressions instead of custom
syntax. use Ruby `eval` and define each field in the item as a local
variable, e.g. `{"animal": "cat"}` lets you use `filter="animal ==
'cat'"`.
- fix heading anchor styles
- add styles for `<details>` element
- fix logo shrinking/growing css bugs

† due to a [github
limitation](https://github.com/peter-evans/create-pull-request/blob/main/docs/concepts-guidelines.md#triggering-further-workflow-runs),
it wouldn't not run anyway on the auto-created PR. the user must
close/reopen the PR, then the regular "on pr" workflow (which includes
running "build preview") will run. i've already [updated the docs to
talk about
this](https://greene-lab.gitbook.io/lab-website-template-docs/basics/citations#periodic-updates).
from now on, let's treat auto-opening PR as the only supported way.
previously i considered that the user could change `open-pr` to `false`
to have "on schedule" commit updated citations directly to `main`, but
let's nix that to maintain simplicity. it's probably better that we
force the user to review the changes before pushing them to their live
site anyway. if we did want to support that in the future, the "build
preview" run i removed would have to be changed to a "build site", since
we'd want to be re-building the `main` branch version of the site, not a
preview for a PR.

---------

Co-authored-by: Faisal Alquaddoomi <[email protected]>

* v1.3.1 (#289)

Closes #288
Closes #287 
Closes #285

New template version checklist:

- [x] I have updated CITATION and CHANGELOG as appropriate.
- [x] I have updated lab-website-template-docs as appropriate.
- [x] I have checked the testbed as appropriate.

---

- use latest major version of setup-ruby gh-action
- run "commit cache" step if citations step fails so that progress
(successful citations) will be saved
- replace xml_escape filter with appropriate escapes for each situation,
and slightly modify regex_strip filter to allow some basic punctuation

* Resolve a few broken binary files because of meld

* Update citations

---------

Co-authored-by: Vincent Rubinetti <[email protected]>
Co-authored-by: HM Rando <[email protected]>
Co-authored-by: Casey Greene <[email protected]>
Co-authored-by: vincerubinetti <[email protected]>
Co-authored-by: Faisal Alquaddoomi <[email protected]>
Co-authored-by: matthuska <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Service Bug Bug fix scope to the pipelines service and launch app
Projects
None yet
Development

No branches or pull requests