aboutsummaryrefslogtreecommitdiff
path: root/include
Commit message (Collapse)AuthorAgeFilesLines
* Rename python_package_exists to pip_index_providesJoseph Hunkeler2024-08-201-3/+10
| | | | | * Document the function prototype * Add missing comments in micromamba structure
* Add python_package_exists() functionJoseph Hunkeler2024-08-171-0/+4
| | | | | * Poll pypi.org or compatible index to see if a package exists * Returns non-zero on success
* Allow the user to disable uploading build info objects to artifactory (#33)Joseph Hunkeler2024-08-171-0/+1
| | | | | * Add enable_artifactory_build_info to globals structure * Add --no-artifactory-build-info command line argument to status main() * Useful for diag/test runs when a fully traceable delivery isn't desired
* Add template convience functions (and bug fixes) (#29)Joseph Hunkeler2024-08-151-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | * Die when render variable is NULL * This was caught when a call to {{ func:xyz() }} lacked opening/closing parenthesis * Scripts in tests should only render template strings right before execution * Remove conda version pin * This avoids updating conda in the base environment * This also avoids pitfalls associated with newly released (always broken) versions of conda * Add two template convenience functions * get_junitxml_result_auto() * get_basetemp_result_auto() * Handle rendering error for test script * Rename functions * get_junitxml_result_auto -> junitxml_file * get_basetemp_result_auto -> basetemp_dir * Thank you, @zacharyburnett
* Remove unused copytree() function (#27)Joseph Hunkeler2024-08-131-18/+0
| | | * Functionality was replaced by rsync long ago
* Move mkdirs() into utils module (#26)Joseph Hunkeler2024-08-132-8/+8
|
* More unit tests (and fixing bugs) (#23)Joseph Hunkeler2024-08-122-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add test_artifactory.c to suite * Add test_ini_getval_wrapper to ini.c * basic ini_getval_TYPE() conversion checks * bugfix: use strtof in INIVAL_TYPE_FLOAT case * Include stdio.h to pull in FILE structure * bugfix: free data at index during strlist_set operation * Previous behavior of setting the pointer to NULL introduced a subtle memory leak * Set strlist error when index it out of range * Import private delivery functions required for mock context creation * Remove static declaration * populate_delivery_cfg() * Add test_junitxml.c * Fix duplicate define value for JUNIT_RESULT_STATE_ERROR * Add static junit test data * Copy test data to current test directory
* Return of the INI refactor (#20)Joseph Hunkeler2024-08-082-22/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Continuation of #19 * Fixes always_update_base_environment override bug added by PR #19 * Finish type hinting implementation * ini_getval_* functions now able to affect rendering mode using INI_READ_RAW and INI_READ_RENDER * Created pointers to deeply nested structures to increase readability * Output from ini_write() is more consistent, with fewer errant spaces and line feeds * Fixes accidental regression in #19. INIVAL_TYPE_STR_ARRAY never produced an array of pointers to char. This needs to be corrected in the future. i.e. It has always generated a new-line delimited string, not a StrList, or array. * Fix strlist_append_tokenize * original pointer is no longer modified * token strings are stripped of leading space before appending to the list * Use defines instead of magic numbers * delivery_init: add render_mode argument * test_conda: Add render mode * test_ini: Add render mode * Only add conda packages and wheels to the image * docker images are saved to the packages directory and will be consumed by the image if present. * Render template variables after bootstrapping the delivery
* Refactor ini getter and setter usage (#19)Joseph Hunkeler2024-08-071-12/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add handler for space-delimited lists * This needs attention, however. The INI writer has no way to know a list with spaces is a list; this happens in the value conversion functions. * Add type_hint member to INIData structure. At some point support with be added for all INIVAL_TYPE_* defines. Right now it's only used with arrays. * Zero out line buffer in ini_open after each iteration * Do not strip raw INI data. Let the conversion functions handle it * Add spaces to key value pairs in rendered INI output. * Add ini_getvar_TYPE() functions * These replace the functionality of static conv_TYPE() functions in delivery.c * Add support for missing types: U/CHAR, U/SHORT, STRLIST * ini_getval: expand template variables immediately before processing the output * Strip leading space to avoid issues with string comparisons against the result * ini_getval: Return copies, not the original. * This forces one to use ini_setval to replace/append values to the data array(s). It's safer this way. * fix_tox_conf(): Use ini_getval and ini_setval instead of modifying the original pointers directly * Tests: Free resources * Replace ini_getval(), ini_getval_required() and conv_*() usage * Now using ini_getval_TYPE() functions and ini_setval() * Remove unused helper functions and variables * download() returns long, not int * actions: update apt cache
* Version in package name (#15)Joseph Hunkeler2024-07-301-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Compile test installation with debug symbols enabled * Fix typo in environment variable name * STASIS_GITHUB_TOKEN is supposed to be STASIS_GH_TOKEN * Add pattern matching mode selector to get_wheel_file() * Adds modes WHEEL_MATCH_EXACT and WHEEL_MATCH_ANY * test block version key is now optional * Now that *_packages lists define the package version through detection, because the end-result version cannot be guaranteed to be identical to the tag. * Find the just-compiled package matching the name and version in the package list. * If compiling master/main this can also match against post-commits (x.y.z.devN+hash) * Versions are extracted from the package name in the list, only if a matching test block exists. Otherwise the string is passed through to pip directly. * Changes indentation level of output * Do not replace @PIP_ARGUMENTS@ with an artifactory URL unless artifactory is enabled * Sequence change * Build requested packages before executing tests. A necessary evil if test blocks are no longer responsible for setting the version data * Show the delivery summary just before test execution, instead of at the start of the program * Terminate package name at version operator when a package is filtered for testing
* Check release (#14)Joseph Hunkeler2024-07-221-2/+40
| | | | | | | | | * Add jfrog_cli_rt_search() and JFRT_Search structure * Ensure authentication arguments are written before a subsystem task's arguments * When artifactory is enabled check if the release is already present. * When artifactory is disabled the check will be made against the local filesystem.
* Regression tests, envctl, and bug fixes (#13)Joseph Hunkeler2024-07-202-9/+40
| | | | | | | | | | | * Found too many bugs * Implements a regression test * Moves and completely refactors the envctl code * Allows the user to keep @STR@ values in output files (if you want full control over where external packages comes from post-build) * Fixes wording in a few places * envctl redaction is not implemented yet. The original redaction code hasn't been modified. * Use generic.ini instead of bare_minimum.ini
* Unit tests (#12)Joseph Hunkeler2024-07-152-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Change return value of conda_setup_headless() from void to int * Replace exit() with return; * Return early if unpacking the micromamba binary fails * Exit program when pointer to INIFILE is NULL. * Validation function cannot otherwise proceed * The way the logic is set up I've decided to duplicate the installation code for now until I find time to revise it * The only meaningful difference between a "fresh start" and reusing the conda installation is a rmtree(). * Exposes STASIS_DOWNLOAD_TIMEOUT environment variable * Sets the connection timeout for libcurl to 30, instead of 300. * Export ini_section_create() function * Add download() tests * Add conda_*() tests * Add boilerplate source file for test framework * Fixes segfault reported by @GeorgeJCleary (#10) * The key is now an array index. When key is -1, the env variable is not defined. * Free resources only when continue on error is disabled (#11) * Fix segfault due to premature shutdown/cleanup * If conda_setup_headless cannot succeed, die * Set STASIS_SYSCONFDIR for tests
* Add github.c and github.h (#9)Joseph Hunkeler2024-07-065-19/+72
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add github.c and github.h * Implements get_github_release_notes() * Remove unused variables * Fix circular dependency on tplfunc_frame * Remove predeclaration of tplfunc_frame * tpl_register_func accepts pointer to void instead * tpl_register_func sets maximum number of arguments * Frame is generated within tpl_register_func * Improve template function error handling and return/output management * Remove redundant extern statement * Include github.h and template_func_proto.h in core.h * Expose get_github_release_notes_tplfunc_entrypoint function to template engine * Add template_func_proto.c and template_func_proto.h * Replace free() with guard variant * Fix test_template::test_tpl_register_func * Fix tests * Fix tests * cmd should be at least PATH_MAX in size. * Magic number caused failure to install conda with a long installation path * Implement get_github_release_notes_auto function that bases release note data off test contexts * Disable overwriting releases by default * Add automatic release note generation function call to release_notes.md.in * Fix test_tpl_register_func() * Add enough space for tar command plus a path * Fix circular include * Github functions do not require access to core.h anyway * Add comments to union * Update README to mention template function availability * Add EnvCtl structure * Add runtime checks to avoid running all the way to the end only to be met with a configuration error. * Rename GITHUB to GH * Development docs pre-rough-draft
* Pass .ci_support/plat_arch_.yaml to conda-build (#8)Joseph Hunkeler2024-06-243-0/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Pass .ci_support/plat_arch_.yaml to conda-build * Fixes a few outstanding leaks in delivery context * Move micromamba function out of stasis_indexer.c * Adjust code in the indexer to accommodate the move. The function now expects a MicromambaInfo structure as its first argument. * Add missing warning message * User is informed when pandoc is not available for HTML page generation * Initialize workdir_template string to zero * Add micromamba program to runtime PATH * Expose storage.tools_dir to template engine * Remove dead code * Fix wording in comment * Fix conda-forge builds * Pass their .ci_support configurations to conda-build in order to fully set up their build runtime environment * Add get_cpu_count() * Exposes STASIS_CPU_COUNT and CPU_COUNT to the runtime environment * Implements conda reactivation template string * {{ workaround.conda_reactivate }} * This is useful to call after installing any conda packages within a test.script * Fix conda runtime inside of test.script * This ensures conda and mamba are fully initialized. * Previous behavior only placed the commands on the PATH but didn't provide any shell macros (i.e. undefined behavior) * Document CPU_COUNT and workaround.conda_reactivate
* Rebrand OhMyCal (OMC) as STASIS (#7)Joseph Hunkeler2024-06-2122-137/+137
|
* Unit tests (#6)Joseph Hunkeler2024-06-206-32/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Initial commit of unit tests [WIP] * Address shortcomings and bugs flushed out by unit tests * Enable unit testing in CI workflow * Enable verbose ctests * Handle lack of __FILE_NAME__ define * Only podman support `run --arch` argument * Skip docker build testing if CI system cannot pull an image * Remove errant call to puts() * Identify local repo user * Fix missing xmllint * NULL terminate arrays * Fix filename assignment in is_url mode * Break loop when expected lines are exhausted * strcmp_array expects NULL terminated array. Iterating by size in this case passes NULL to strcmp leading to an invalid read * Remove debug printf statements * Disable a few warnings for tests * Workaround for ctest junit xml truncation * Update checkout@v4 * Prevent false-positive result * Return zero on error * Fix strlist_remove function * Value argument can be constant * Fix test to match changes to startswith and endswith * Add test_ini.c * Fix redaction code to accept NULL pointers in array * And let the caller specify the length of the array of strings to redact. * Redactions now occur directly on authentication strings rather than their command line arguments * Fix BUILD_TESTING_DEBUG * Adds missing -D argument
* Remove newlineJoseph Hunkeler2024-05-211-1/+0
|
* Consolidate OMC_COLOR_ definesJoseph Hunkeler2024-05-211-0/+40
|
* Documentation updateJoseph Hunkeler2024-05-202-2/+293
|
* junitxml: add missing "error" typeJoseph Hunkeler2024-05-171-18/+49
|
* DocumentationJoseph Hunkeler2024-05-161-0/+57
|
* First pass at test result creation, and optional markdown->html conversionJoseph Hunkeler2024-05-162-0/+48
|
* Allow doxygen to ingest header fileJoseph Hunkeler2024-05-031-4/+4
|
* Add delivery_dump_metadata()Joseph Hunkeler2024-05-021-0/+3
|
* Move listdir to utils.c and export prototypeJoseph Hunkeler2024-05-021-0/+3
|
* Convert ohmycal to a libraryJoseph Hunkeler2024-05-021-0/+5
|
* Move artifactory authentication redaction code into its own function: ↵Joseph Hunkeler2024-04-151-0/+43
| | | | redact_sensitive()
* Add ini_has_key() and expose ini_section_search() functionJoseph Hunkeler2024-04-151-0/+20
| | | | * ini_section_search now has three matching modes _EXACT, _BEGINS, and _SUBSTR
* Add ini_setval() functionJoseph Hunkeler2024-04-151-0/+13
|
* Save raw and rendered versions of the input configuration.Joseph Hunkeler2024-04-121-0/+1
|
* Export bootstrap_build_info()Joseph Hunkeler2024-04-121-0/+3
|
* Allow filtering of tags from repositories during build/test phaseJoseph Hunkeler2024-04-121-8/+9
| | | | | * The version requested and the tag resolved by git describe may be different if the project's maintainer tagged a commit object more than once. * If version 1.2.3 and 1.2.3a fall on the same commit, one can now filter the "a" to ensure the tag is reported correctly during build/test.
* Remove HOME redirectionJoseph Hunkeler2024-04-101-1/+0
| | | | * If the user wants that, they need to reassign HOME manually prior to executing OMC
* fixme: add artifactory url to globalsJoseph Hunkeler2024-04-101-0/+1
|
* Stop duplicating the jfrog authentication context for each upload context.Joseph Hunkeler2024-04-101-1/+2
| | | | | | * We only need one * RAM isn't peppered with auth data * The artifactory URL has been consolidated and exposed as a template variable: deploy.jfrog.url
* Consolidate INIFILE handling across the delivery contextJoseph Hunkeler2024-04-101-0/+12
| | | | * Break delivery_init() into separate populate_* functions
* We no longer pass INIFILE pointers to delivery_init()Joseph Hunkeler2024-04-101-1/+1
|
* Rewriting the specfile is now a two stage processJoseph Hunkeler2024-04-101-1/+4
| | | | | * This allows for generating a template spec file that can consumed and manipulated by the Dockerfile, and OMC's machinery * To reduce complexity the tpl_* functions are not used.
* Add docker_validate_image_compression()Joseph Hunkeler2024-04-101-0/+2
|
* Add docker_sanitize_tag()Joseph Hunkeler2024-04-101-0/+1
| | | | * Replace invalid docker tag characters with dash ('-')
* Write conda installer to a temporary location instead of the current working ↵Joseph Hunkeler2024-04-101-3/+4
| | | | | | directory * Replaces function argument "delivery" with "ctx" for better consistency
* Reenable installation via local wheelsJoseph Hunkeler2024-04-021-0/+1
|
* Include wheel.hJoseph Hunkeler2024-04-021-0/+1
|
* Reset HOME to point to a temporary directory to prevent contaminating the ↵Joseph Hunkeler2024-04-021-0/+1
| | | | user account's home directory with build artifacts, caches, and other artifacts
* Use do-while in COE_CHECK_ABORT.Joseph Hunkeler2024-04-021-6/+7
| | | | | * continue_on_error is always checked * An additional conditional can be passed. Use `1` to fail normally. Use `0` to never fail.
* Add REPLACE_TRUNCATE_AFTER_MATCH mode to replace_textJoseph Hunkeler2024-04-021-2/+4
|
* Adjust guard_strlist_free to match new function signatureJoseph Hunkeler2024-04-021-1/+1
|
* Changes to strlist_*() functions:Joseph Hunkeler2024-04-021-3/+3
| | | | | Functions that modify the input StrList have been refactored to use `struct StrList **` instead of `struct StrList *`. * Fixes realloc error handling
* Changes to ini_write() behavior:Joseph Hunkeler2024-04-021-1/+5
| | | | | | * Caller can choose to dump raw unmodified key/value pairs, or render all values through the template engine * Fixes spurious line feeds injected into the output stream * Uses LINE_SEP instead of "\n"