Giter VIP home page Giter VIP logo

actions's Introduction

HyP3 documentation

DOI

HyP3 documentation is built using MkDocs and the ASF Theme.

How to

Setting up a development environment

In order to automatically document some of our APIs, we use a conda environment with our APIs installed. You can get Miniconda (recommended) here:

https://docs.conda.io/en/latest/miniconda.html

Once conda is installed, from the repository root, you can create and activate a conda environment with all the necessary dependencies

conda env create -f environment.yml
conda activate hyp3-docs

Later, you can update the environment's dependencies with

conda env update -f environment.yml

Build and view the documentation site

With the hyp3-docs conda environment activated, run

mkdocs serve

to generate the documentation. This will allow you to view it at http://127.0.0.1:8000/. MkDocs will automatically watch for new/changed files in this directory and rebuild the website so you can see your changes live (just refresh the webpage!).

Note: mkdocs serve captures your terminal; use crtl+c to exit. It is recommended you use a second/dedicated terminal so you can keep this command running.

Deploy

This documentation site is deployed as a GitHub Organization website with a CNAME so that it's viewable at https://hyp3-docs.asf.alaska.edu/. The website is served out of the special https://github.com/ASFHyP3/ASFHyP3.github.io repository. Deployment is handled automatically with the .github/workflows/deploy_to_github_io.yml GitHub Action for any merge to main.

There is also a test site deployed to https://hyp3-docs.asf.alaska.edu/hyp3-docs, which tracks the develop branch of this repo and is served out of the gh-pages branch of this repo.

Enable or disable the announcement banner

We can display a site-wide banner for important announcements. The content of this banner is specified in overrides/main.html, which should contain the following placeholder text when the banner is not in use:

{% extends "partials/main.html" %}

{# Uncomment this block to enable the announcement banner:
{% block announce %}
<div id="announcement-content">
    ⚠️ TODO: Your announcement here.<br />
    <a class="announcement-link" href="TODO">Read the full announcement.</a>
</div>
{% endblock %}
#}

In order to enable the banner, uncomment the announce block and fill in the TODOs. Below is an example of an enabled announcement banner (taken from here):

{% extends "partials/main.html" %}

{% block announce %}
<div id="announcement-content">
    ⚠️ Monthly processing quotas were replaced by a credit system on April 1st.<br />
    <a class="announcement-link" href="/using/credits">Read the full announcement.</a>
</div>
{% endblock %}

When the announcement is no longer needed, restore the file to the placeholder text in order to disable the banner.

If you are building and viewing the site locally, you will need to exit with ctrl+c and then re-run mkdocs serve in order to re-render any changes you make to this file.

Markdown formatting

The way MkDocs and GitHub parse the markdown documents are slightly different. Some compatibility tips:

  • Raw links should be wrapped in angle brackets: <https://example.com>

  • MkDocs is pickier about whitespace between types (e.g., headers, paragraphs, lists) and seems to expect indents to be 4 spaces. So to get a representation like:


    • A list item

      A sub list heading
      • A sub-list item

    in MkDocs, you'll want to write it like:

    Good

    - A list item
    
        ##### A sub list heading
        - A sub-list item
    

    Bad

    - A list item
      ##### A sub list heading
      - A sub-list item
    
    - A list item
        ##### A sub list heading
        - A sub-list item
    
    - A list item
    
      ##### A sub list heading
      - A sub-list item
    

actions's People

Contributors

andrewplayer3 avatar asjohnston-asf avatar cirrusasf avatar dependabot[bot] avatar forrestfwilliams avatar jacquelynsmale avatar jhkennedy avatar jtherrmann avatar tools-bot avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

Forkers

jhkennedy

actions's Issues

repo-sync/pull-request has been deprecated and arcived.

Jira: https://asfdaac.atlassian.net/browse/TOOL-2395

Note: The above link is accessible only to members of ASF.


We're using repo-sync/pull-request in a number of places, but it's been deprecated and the repo archived. We can switch to using the GitHub CLI in actions as here:
https://github.com/ASFHyP3/actions/blob/develop/.github/workflows/update-examples.yml#L52-L58

Will need to update all these locations:
https://github.com/search?q=org%3AASFHyP3+repo-sync%2Fpull-request&type=code

Add static analysis of Markdown files

Jira: https://asfdaac.atlassian.net/browse/TOOL-2396

Note: The above link is accessible only to members of ASF.


We use markdown files broadly for both documentation and particularly our changelogs, but formatting styles vary significantly. For example, "platform" changelogs are significantly more compact:

## [3.3.0]
### Added
- Added `hyp3-carter` deployment.
- An [`INSAR_GAMMA_TEST.yml`](job_spec/INSAR_GAMMA_TEST.yml) job spec  has been added, exposing the adaptive phase filter parameter used when processing InSAR products.
- `INSAR_GAMMA_TEST.yml` job spec has been added to the HyP3 Enterprise Test and HyP3 AVO deployments.

## [3.2.1]
### Changed
- Increased the `hyp3-streamflow` product lifecycle from 14 days to 90 days.
- Increased the `hyp3-streamflow` vCPU limit from 640 to 1600.

than typical "plugin" changelogs:

## [0.9.1]

### Changed
* [A patch](hyp3_autorift/vend/CHANGES-176.diff) was applied to update some netCDF variable attributes, as described
  in the [vendored software README.md](hyp3_autorift/vend/README.md)

## [0.9.0]

### Added
* Added support for processing Landsat-4, -5, and -7 Collection 2 scenes
* `hyp3_autorift.process.get_lc2_stac_json_key` will now work for landsat missions 4-9 and for all sensors

### Changed
* Upgraded autoRIFT to [v1.5.0](https://github.com/nasa-jpl/autoRIFT/releases/tag/v1.5.0) 
  and [ISCE2 v2.6.1 built with autoRIFT v1.5.0](https://anaconda.org/hyp3/isce2)

### Fixed 
* Pinned Python to `<3.10` as ISCE2 is currently [incompatible with Python 3.10](https://github.com/isce-framework/isce2/issues/458).
  This restriction will be lifted once the conda-forge distribution of ISCE2 is compatible with Python 3.10

We should:

  • decide if we want to enforce formatting choices
  • if so, add a linter like markdownlint to the static analysis reusable workflow

Make Docker (and other?) actions fork-safe

The docker build action always tries to push to GHCR, and thus will fail for forks as they don't have permission to push to GHCR. We should either figure out how to allow pushes from forks (maybe not the best idea from a sec perspective!) or skip the push action for forks.

Reusable Changelog Check is not fork-safe

Jira: https://asfdaac.atlassian.net/browse/TOOL-2863

Note: The above link is accessible only to members of ASF.


The Reusable Changelog Check action uses Zomzog/changelog-checker under the hood with the default checkNotification: Detailed:

The checkNotification allows switching between Simple and Detailed checks. The simple check is based on the default check of the action. The detailed check will create a second check with a more precise message, but it required write access so it does not work with forks.

Detailed check fallback to simple for forks.

Even though it says it falls back to the simple check for forks, it still tries to create a secondary check and fails with HTTP 403. We see this most often with dependabot PRs (effectively fork PRs), which shouldn't run the detailed check as they are labeled bumpless but still fail with HTTP 403 errors when trying to create the secondary check:

It does seem to still work for non-forks, e.g.:

However, Zomzog/changelog-checker is a Node.js 12 action, which is being forced to run on Node.js 16, which is also deprecated and should be running on Node.js 20 now. The last release was in Sept. 2022, and it hasn't seen a commit on the default branch since Jul. 2023, so we should find an alternative for this action.

tarides/changelog-check-action looks like a potential alternative, but it doesn't allow you to customize the no changelog label, so we'd need to contribute that upstream. Notably, tarides/changelog-check-action is just a really simple shell script:
https://github.com/tarides/changelog-check-action/blob/main/check.sh
so we could also implement something similar ourselves.

Upgrade or abandon Gitleaks Action

Gitleaks Action v2 requires a paid license. We are currently pinned to the older version, which is not a great long-term solution because it's not receiving any updates. Possible solutions:

  • Run the Gitleaks core tool (which is open-source) as a pre-commit hook (see here and here). The only disadvantage would be that we would need to trust everyone on the team to configure this individually.
  • Abandon Gitleaks if we don't feel it's providing us enough extra value in addition to Trufflehog and git-secrets. I haven't yet found any useful comparisons of Gitleaks with either of these two other tools. I've contacted the Gitleaks team via this form to ask if they can provide these comparisons and a justification for using their tool over the other two.
  • Buy the license. At our current number of repos, with the "Pro" plan, we'd be paying (27 repos)*(8.75 USD per repo per month) = $236.25 per month. We could also limit our use to just the repos we really care about, or perhaps find some clever way to reduce the cost by mirroring all of our repos in a single monorepo and only scanning that repo?

Also see:

Keeping README up to date

When we release a new version, the examples in the README fall out of date if we didn't update them before release.

BUT updating develop before release would mean our primary documentation (the README) and examples would show an unreleased version until released, which is more and more problematic the longer it takes.

Typically, we've released and then gone back and updated the README after... sometimes long after.

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.