Blame CONTRIBUTING.md

Packit Service 4684c1
# GnuTLS -- Information about our contribution rules and coding style
Packit Service 4684c1
Packit Service 4684c1
 Anyone is welcome to contribute to GnuTLS. You can either take up
Packit Service 4684c1
tasks from our [planned list](https://gitlab.com/gnutls/gnutls/milestones),
Packit Service 4684c1
or suprise us with enhancement we didn't plan for. In all cases be prepared
Packit Service 4684c1
to defend and justify your enhancements, and get through few rounds
Packit Service 4684c1
of changes. 
Packit Service 4684c1
Packit Service 4684c1
We try to stick to the following rules, so when contributing please
Packit Service 4684c1
try to follow them too.
Packit Service 4684c1
Packit Service 4684c1
Packit Service 4684c1
# Git commits:
Packit Service 4684c1
Packit Service 4684c1
Note that when contributing code you will need to assert that the contribution is
Packit Service 4684c1
in accordance to the "Developer's Certificate of Origin" as found in the 
Packit Service 4684c1
file [DCO.txt](doc/DCO.txt).
Packit Service 4684c1
Packit Service 4684c1
To indicate that, make sure that your contributions (patches or merge requests),
Packit Service 4684c1
contain a "Signed-off-by" line, with your real name and e-mail address. 
Packit Service 4684c1
To automate the process use "git am -s" to produce patches and/or set the
Packit Service 4684c1
a template to simplify this process, as follows.
Packit Service 4684c1
Packit Service 4684c1
```
Packit Service 4684c1
$ cp devel/git-template ~/.git-template
Packit Service 4684c1
[edit]
Packit Service 4684c1
$ git config commit.template ~/.git-template
Packit Service 4684c1
```
Packit Service 4684c1
Packit Service 4684c1
Packit Service 4684c1
# Test suite:
Packit Service 4684c1
Packit Service 4684c1
   New functionality should be accompanied by a test case which verifies
Packit Service 4684c1
the correctness of GnuTLS' operation on successful use of the new
Packit Service 4684c1
functionality, as well as on fail cases. The GnuTLS test suite is run on "make check"
Packit Service 4684c1
on every system GnuTLS is installed, except for the tests/suite part
Packit Service 4684c1
which is only run during development.
Packit Service 4684c1
Packit Service 4684c1
For testing functionality of gnutls we use two test unit testing frameworks:
Packit Service 4684c1
1. The gnutls testing framework as in [utils.h](tests/utils.h), usually for high level
Packit Service 4684c1
   tests such as testing a client against a server. See [set_x509_key_mem.c](tests/set_x509_key_mem.c).
Packit Service 4684c1
2. The cmocka unit testing framework, for unit testing of functions
Packit Service 4684c1
   or interfaces. See [dtls-sliding-window.c](tests/dtls-sliding-window.c).
Packit Service 4684c1
Packit Service 4684c1
Certificates for testing purposes are available at [cert-common.h](tests/cert-common.h).
Packit Service 4684c1
Note that we do not regenerate test certificates when they expire, but
Packit Service 4684c1
we rather fix the test's time using datefudge or gnutls_global_set_time_function().
Packit Service 4684c1
For example, see [x509cert-tl.c](tests/x509cert-tl.c).
Packit Service 4684c1
Packit Service 4684c1
Packit Service 4684c1
# File names:
Packit Service 4684c1
Packit Service 4684c1
  Files are split to directories according to the subsystem
Packit Service 4684c1
they belong to. Examples are x509/, minitasn1/, openpgp/,
Packit Service 4684c1
opencdk/ etc. The files in the root directory related
Packit Service 4684c1
to the main TLS protocol implementation.
Packit Service 4684c1
Packit Service 4684c1
Packit Service 4684c1
# C dialect:
Packit Service 4684c1
Packit Service 4684c1
  While parts of GnuTLS were written in older dialects, new code
Packit Service 4684c1
in GnuTLS are expected to conform to C99. Exceptions could be made
Packit Service 4684c1
for C99 features that are not supported in popular platforms on a
Packit Service 4684c1
case by case basis.
Packit Service 4684c1
Packit Service 4684c1
Packit Service 4684c1
# Indentation style:
Packit Service 4684c1
Packit Service 4684c1
 In general, use [the Linux kernel coding style](https://www.kernel.org/doc/html/latest/process/coding-style.html).
Packit Service 4684c1
You may indent the source using GNU indent, e.g. "indent -linux *.c".
Packit Service 4684c1
Packit Service 4684c1
Packit Service 4684c1
# Commenting style
Packit Service 4684c1
Packit Service 4684c1
In general for documenting new code we prefer self-documented code to comments. That is:
Packit Service 4684c1
  - Meaningful function and macro names
Packit Service 4684c1
  - Short functions which do a single thing
Packit Service 4684c1
Packit Service 4684c1
That does not mean that no comments are allowed, but that when they are
Packit Service 4684c1
used, they are used to document something that is not obvious, or the protocol
Packit Service 4684c1
expectations. Though we haven't followed that rule strictly in the past, it
Packit Service 4684c1
should be followed on new code.
Packit Service 4684c1
Packit Service 4684c1
Packit Service 4684c1
# Function names:
Packit Service 4684c1
Packit Service 4684c1
  All the function names use underscore ```_```, to separate words,
Packit Service 4684c1
functions like ```gnutlsDoThat``` are not used. The exported function names
Packit Service 4684c1
usually start with the ```gnutls_``` prefix, and the words that follow
Packit Service 4684c1
specify the exact subsystem of gnutls that this function refers to.
Packit Service 4684c1
E.g. ```gnutls_x509_crt_get_dn```, refers to the X.509
Packit Service 4684c1
certificate parsing part of gnutls. Some of the used prefixes are the
Packit Service 4684c1
following.
Packit Service 4684c1
 * ```gnutls_x509_crt_``` for the X.509 certificate part
Packit Service 4684c1
 * ```gnutls_session_``` for the TLS session part (but this may be omited)
Packit Service 4684c1
 * ```gnutls_handshake_``` for the TLS handshake part
Packit Service 4684c1
 * ```gnutls_record_``` for the TLS record protocol part
Packit Service 4684c1
 * ```gnutls_alert_``` for the TLS alert protocol part
Packit Service 4684c1
 * ```gnutls_credentials_``` for the credentials structures
Packit Service 4684c1
 * ```gnutls_global_``` for the global structures handling
Packit Service 4684c1
Packit Service 4684c1
All exported API functions must be listed in libgnutls.map
Packit Service 4684c1
in order to be exported.
Packit Service 4684c1
Packit Service 4684c1
Internal functions, i.e, functions that are not exported in the API but
Packit Service 4684c1
are used internally by multiple files, should be prefixed with an underscore.
Packit Service 4684c1
For example `_gnutls_handshake_begin()`.
Packit Service 4684c1
Packit Service 4684c1
Internal functions restricted to a file (static), or inline functions, should
Packit Service 4684c1
not use the `_gnutls` prefix for simplicity, e.g., `get_version()`.
Packit Service 4684c1
Packit Service 4684c1
Internal structures should not be exported. Especially pointers to
Packit Service 4684c1
internal data. Doing so harms future reorganization/rewrite of subsystems.
Packit Service 4684c1
They can however be used by unit tests in tests/ directory; in that
Packit Service 4684c1
case they should be part of the GNUTLS_PRIVATE_3_4 tag in libgnutls.map.
Packit Service 4684c1
Packit Service 4684c1
Packit Service 4684c1
# Header guards
Packit Service 4684c1
Packit Service 4684c1
  Each private C header file SHOULD have a header guard consisting of the
Packit Service 4684c1
project name and the file path relative to the project directory, all uppercase.
Packit Service 4684c1
Packit Service 4684c1
Example: `lib/srp.h` uses the header guard `GNUTLS_LIB_SRP_H`.
Packit Service 4684c1
Packit Service 4684c1
The header guard is used as first and last effective code in a header file,
Packit Service 4684c1
like e.g. in lib/srp.h:
Packit Service 4684c1
Packit Service 4684c1
```
Packit Service 4684c1
#ifndef GNUTLS_LIB_SRP_H
Packit Service 4684c1
#define GNUTLS_LIB_SRP_H
Packit Service 4684c1
Packit Service 4684c1
...
Packit Service 4684c1
Packit Service 4684c1
#endif /* GNUTLS_LIB_SRP_H */
Packit Service 4684c1
```
Packit Service 4684c1
Packit Service 4684c1
The public header files follow a similar convention but use the relative
Packit Service 4684c1
install directory as template, e.g. `GNUTLS_GNUTLS_H` for `gnutls/gnutls.h`.
Packit Service 4684c1
Packit Service 4684c1
Packit Service 4684c1
# Introducing new functions / API
Packit Service 4684c1
Packit Service 4684c1
  Prior to introducing any new API consider all options to offer the same
Packit Service 4684c1
functionality without introducing a new function. The reason is that  we want
Packit Service 4684c1
to avoid breaking the ABI, and thus we cannot typically remove any function
Packit Service 4684c1
that was added (though we have few exceptions). Since we cannot remove, it
Packit Service 4684c1
means that experimental APIs, or helper APIs that are not typically needed
Packit Service 4684c1
may become a burden to maintain in the future. That is, they may prevent
Packit Service 4684c1
a refactoring, or require to keep legacy code.
Packit Service 4684c1
Packit Service 4684c1
As such, some questions to answer before adding a new API:
Packit Service 4684c1
 * Is this API useful for a large class of applications, or is it limited
Packit Service 4684c1
   to few?
Packit Service 4684c1
 * If it is limited to few, can we work around that functionality without
Packit Service 4684c1
   a new API?
Packit Service 4684c1
 * Would that function be relevant in the future when a new protocol such TLS
Packit Service 4684c1
   13.0 is made available? Would it harm the addition of a new protocol?
Packit Service 4684c1
Packit Service 4684c1
Packit Service 4684c1
The make rule 'abi-check' verifies that the ABI remained compatible since
Packit Service 4684c1
the last tagged release. It relies on the git tree and abi-compliance-checker.
Packit Service 4684c1
Packit Service 4684c1
The above do not apply to the C++ library; this library's ABI should not
Packit Service 4684c1
be considered stable.
Packit Service 4684c1
Packit Service 4684c1
Packit Service 4684c1
# Introducing new features / modifying behavior
Packit Service 4684c1
Packit Service 4684c1
  When a new feature is introduced which may affect already deployed code, 
Packit Service 4684c1
it must be disabled by default. For example a new TLS extension should be
Packit Service 4684c1
enabled when explicitly requested by the application. That can happen for
Packit Service 4684c1
example with a gnutls_init() flag.
Packit Service 4684c1
Packit Service 4684c1
The same should be followed when an existing function behavior is modified
Packit Service 4684c1
in a way that may break existing applications which use the API in a
Packit Service 4684c1
reasonable way. If the existing function allows flags, then a new flag
Packit Service 4684c1
should be introduced to enable the new behavior.
Packit Service 4684c1
Packit Service 4684c1
When it is necessary, or desireable to enable the new features by default
Packit Service 4684c1
(e.g., TLS1.3 introduction), the "next" releases should be used (and
Packit Service 4684c1
introduced if necessary), to allow the modification to be tested for an
Packit Service 4684c1
extended amount of time (see the [Release policy](RELEASES.md)).
Packit Service 4684c1
Packit Service 4684c1
Packit Service 4684c1
# API documentation
Packit Service 4684c1
Packit Service 4684c1
When introducing a new API, we provide the function documentation as
Packit Service 4684c1
inline comments, in a way that it can be used to generate a man-page
Packit Service 4684c1
and be included in our manual. For that we use gnome-style comments
Packit Service 4684c1
as in the example below. The detailed form is documented on `doc/scripts/gdoc`.
Packit Service 4684c1
Packit Service 4684c1
/**
Packit Service 4684c1
 * gnutls_init:
Packit Service 4684c1
 * @session: is a pointer to a #gnutls_session_t type.
Packit Service 4684c1
 * @flags: indicate if this session is to be used for server or client.
Packit Service 4684c1
 *
Packit Service 4684c1
 * This function initializes the provided session. Every
Packit Service 4684c1
 * session must be initialized before use, and must be deinitialized
Packit Service 4684c1
 * after used by calling gnutls_deinit().
Packit Service 4684c1
 *
Packit Service 4684c1
 * @flags can be any combination of flags from %gnutls_init_flags_t.
Packit Service 4684c1
 *
Packit Service 4684c1
 * Note that since version 3.1.2 this function enables some common
Packit Service 4684c1
 * TLS extensions such as session tickets and OCSP certificate status
Packit Service 4684c1
 * request in client side by default. To prevent that use the %GNUTLS_NO_EXTENSIONS
Packit Service 4684c1
 * flag.
Packit Service 4684c1
 *
Packit Service 4684c1
 * Returns: %GNUTLS_E_SUCCESS on success, or a negative error code.
Packit Service 4684c1
 **/
Packit Service 4684c1
Packit Service 4684c1
Packit Service 4684c1
# Constructed types:
Packit Service 4684c1
Packit Service 4684c1
  The constructed types in gnutls always have the ```gnutls_``` prefix.
Packit Service 4684c1
Definitions, value defaults and enumerated values should be in
Packit Service 4684c1
capitals. E.g. ```GNUTLS_CIPHER_3DES_CBC```.
Packit Service 4684c1
Packit Service 4684c1
Structures should have the ```_st``` suffix in their name even
Packit Service 4684c1
if they are a typedef. One can use the sizeof() on types with 
Packit Service 4684c1
```_st``` as suffix to get the structure's size.
Packit Service 4684c1
Packit Service 4684c1
Other constructed types should have the ```_t``` suffix. A pointer
Packit Service 4684c1
to a structure also has the ```_t``` suffix.
Packit Service 4684c1
Packit Service 4684c1
Packit Service 4684c1
# Function parameters:
Packit Service 4684c1
Packit Service 4684c1
The gnutls functions accept parameters in the order:
Packit Service 4684c1
 1. Input parameters
Packit Service 4684c1
 2. Output parameters
Packit Service 4684c1
Packit Service 4684c1
When data and size are expected as input, a const gnutls_datum_t structure
Packit Service 4684c1
should be used (or more precisely a pointer to the structure).
Packit Service 4684c1
Packit Service 4684c1
When data pointer and size are to be returned as output, a gnutls_datum_t
Packit Service 4684c1
structure should be used.
Packit Service 4684c1
Packit Service 4684c1
When output is to be copied to caller an array of fixed data should be
Packit Service 4684c1
provided.
Packit Service 4684c1
Packit Service 4684c1
Packit Service 4684c1
# Callback function parameters:
Packit Service 4684c1
Packit Service 4684c1
 Callback functions should be avoided, if this is possible. 
Packit Service 4684c1
Callbacks that refer to a TLS session should include the
Packit Service 4684c1
current session as a parameter, in order for the called function to
Packit Service 4684c1
be able to retrieve the data associated with the session.
Packit Service 4684c1
This is not always done though -- see the push/pull callbacks.
Packit Service 4684c1
Packit Service 4684c1
Packit Service 4684c1
# Return values:
Packit Service 4684c1
Packit Service 4684c1
 Functions in gnutls return an int type, when possible. In that
Packit Service 4684c1
case 0 should be returned in case of success, or maybe a positive
Packit Service 4684c1
value, if some other indication is needed.
Packit Service 4684c1
Packit Service 4684c1
A negative value always indicates failure. All the available
Packit Service 4684c1
error codes are defined in gnutls.h and a description
Packit Service 4684c1
is available in gnutls_errors.c
Packit Service 4684c1
Packit Service 4684c1
Packit Service 4684c1
Functions which are intended to return a boolean value should return
Packit Service 4684c1
a type of bool, and it is recommended to contain the string '_is_'
Packit Service 4684c1
on its function name; e.g.,
Packit Service 4684c1
```
Packit Service 4684c1
bool _gnutls_is_not_prehashed();
Packit Service 4684c1
```
Packit Service 4684c1
Packit Service 4684c1
That allows the distinguishing functions that return negative errors
Packit Service 4684c1
from boolean functions to both the developer and the compiler. Note
Packit Service 4684c1
that in the past the 'unsigned' type was used to distinguish boolean functions
Packit Service 4684c1
and several of these still exist.
Packit Service 4684c1
Packit Service 4684c1
## Selecting the right return value
Packit Service 4684c1
Packit Service 4684c1
When selecting the return value for a TLS protocol parsing function
Packit Service 4684c1
a suggested approach is to check which alert fits best on that error
Packit Service 4684c1
(see `alert.c`), and then select from the error codes which are mapped
Packit Service 4684c1
to that alert (see `gnutls_error_to_alert()`). For more generic parsing
Packit Service 4684c1
errors consider using the `GNUTLS_E_RECEIVED_ILLEGAL_PARAMETER`.
Packit Service 4684c1
Packit Service 4684c1
Packit Service 4684c1
# Usage of assert()
Packit Service 4684c1
Packit Service 4684c1
 The assert() macro --not to be confused with gnutls_assert()-- is used
Packit Service 4684c1
exceptionally on impossible situations to assist static analysis tools.
Packit Service 4684c1
That is, it should be used when the static analyzer used in CI (currently
Packit Service 4684c1
clang analyzer), detects an error which is on an impossible situation.
Packit Service 4684c1
In these cases assert() is used to rule out that case.
Packit Service 4684c1
Packit Service 4684c1
For example in the situation where a pointer is known to be non-null,
Packit Service 4684c1
but the static analyzer cannot rule it out, we use code like the following:
Packit Service 4684c1
```
Packit Service 4684c1
assert(ptr != NULL);
Packit Service 4684c1
ptr->deref = 3;
Packit Service 4684c1
```
Packit Service 4684c1
Packit Service 4684c1
Since GnuTLS is a library no other uses of assert() macro are acceptable.
Packit Service 4684c1
Packit Service 4684c1
The NDEBUG macro is not used in GnuTLS compilation, so the assert() macros
Packit Service 4684c1
are always active.
Packit Service 4684c1
Packit Service 4684c1
Packit Service 4684c1
# Gnulib
Packit Service 4684c1
Packit Service 4684c1
The directories `gl/`, `src/gl/` and `lib/unistring` contain gnulib files
Packit Service 4684c1
copied/created by `./bootstrap`. Gnulib is a portability source code library
Packit Service 4684c1
to handle API or behavior incompatibilities between target systems.
Packit Service 4684c1
Packit Service 4684c1
To take advantage of the latest gnulib files, we have to update the
Packit Service 4684c1
`gnulib/` submodule from time to time:
Packit Service 4684c1
```
Packit Service 4684c1
$ make glimport
Packit Service 4684c1
```
Packit Service 4684c1
Packit Service 4684c1
Note that the gnulib library in `gl/` is used by the GnuTLS library
Packit Service 4684c1
and is kept separate from the gnulib used by the GnuTLS tools because
Packit Service 4684c1
of license issues, and also to prevent any gnulib networking modules
Packit Service 4684c1
from entering the library (gnulib networking re-implements the windows
Packit Service 4684c1
network stack and causes issues to gnutls applications running on windows).
Packit Service 4684c1
Packit Service 4684c1
Packit Service 4684c1
# Compiler warnings
Packit Service 4684c1
Packit Service 4684c1
The compiler prints warnings for several reasons; these warnings are
Packit Service 4684c1
also not constant in time, different versions of the same compiler may
Packit Service 4684c1
warn about different issues.
Packit Service 4684c1
Packit Service 4684c1
In GnuTLS we enable as many as possible warnings available in the compiler
Packit Service 4684c1
via configure.ac. On certain cases however we silence or disable warnings
Packit Service 4684c1
and the following subsections go case by case.
Packit Service 4684c1
Packit Service 4684c1
## Switch unintended fall-through warnings
Packit Service 4684c1
Packit Service 4684c1
These we silence by using the macro FALLTHROUGH under a switch
Packit Service 4684c1
statement which intentionally falls through. Example:
Packit Service 4684c1
```
Packit Service 4684c1
switch (session->internals.recv_state) {
Packit Service 4684c1
        case RECV_STATE_DTLS_RETRANSMIT:
Packit Service 4684c1
                ret = _dtls_retransmit(session);
Packit Service 4684c1
                if (ret < 0)
Packit Service 4684c1
                        return gnutls_assert_val(ret);
Packit Service 4684c1
Packit Service 4684c1
                session->internals.recv_state = RECV_STATE_0;
Packit Service 4684c1
                FALLTHROUGH;
Packit Service 4684c1
        case RECV_STATE_0:
Packit Service 4684c1
Packit Service 4684c1
                _dtls_async_timer_check(session);
Packit Service 4684c1
                return 1;
Packit Service 4684c1
}
Packit Service 4684c1
```
Packit Service 4684c1
Packit Service 4684c1
Packit Service 4684c1
# Symbol and library versioning
Packit Service 4684c1
Packit Service 4684c1
 The library uses the libtool versioning system, which in turn
Packit Service 4684c1
results to a soname bump on incompatible changes. That is described
Packit Service 4684c1
in [hooks.m4](m4/hooks.m4). Despite its complexity that system is
Packit Service 4684c1
only sufficient to distinguish between versions of the library that
Packit Service 4684c1
have broke ABI (i.e., soname bump occurred).
Packit Service 4684c1
Packit Service 4684c1
Today however, soname versioning isn't sufficient. Symbol versioning
Packit Service 4684c1
as provided by [libgnutls.map](lib/libgnutls.map) have several
Packit Service 4684c1
advantages.
Packit Service 4684c1
 * they allow for symbol clashing between different gnutls library
Packit Service 4684c1
   versions being in the same address space.
Packit Service 4684c1
 * they allow installers to detect the library version used for
Packit Service 4684c1
   an application utilizing a specific symbol
Packit Service 4684c1
 * the allow introducing multiple versions of a symbol a la libc,
Packit Service 4684c1
   keeping the semantics of old functions while introducing new.
Packit Service 4684c1
Packit Service 4684c1
As such for every symbol introduced on a particular version, we
Packit Service 4684c1
create an entry in libgnutls.map based on the version and containing
Packit Service 4684c1
the new symbols. For example, if in version 3.6.2 we introduce symbol
Packit Service 4684c1
```gnutls_xyz```, the entry would be:
Packit Service 4684c1
Packit Service 4684c1
GNUTLS_3_6_2 {
Packit Service 4684c1
  global:
Packit Service 4684c1
	gnutls_xyz;
Packit Service 4684c1
} GNUTLS_3_6_1;
Packit Service 4684c1
Packit Service 4684c1
where ```GNUTLS_3_6_1``` is the last version that symbols were introduced,
Packit Service 4684c1
and indicates a dependency of 3.6.2 to symbols of 3.6.1.
Packit Service 4684c1
Packit Service 4684c1
Note that when the soname version is bumped, i.e., the ABI is broken
Packit Service 4684c1
all the previous symbol versions should be combined into a single. For
Packit Service 4684c1
example on the 3.4.0 soname bump, all symbols were put under the
Packit Service 4684c1
GNUTLS_3_4 version.
Packit Service 4684c1
Packit Service 4684c1
Backporting new symbols to an old version which is soname compatible
Packit Service 4684c1
is not allowed (can cause quite some problems). Backporting symbols
Packit Service 4684c1
to an incompatible soname version is allowed, but must ensure that
Packit Service 4684c1
the symbol version used for the backported symbol version is distinct from
Packit Service 4684c1
the original library symbol version. E.g., if symbol ```gnutls_xyz```
Packit Service 4684c1
with version GNUTLS_3_6_3 is backported on gnutls 3.3.15, it should
Packit Service 4684c1
use version GNUTLS_3_3_15.
Packit Service 4684c1
Packit Service 4684c1
Packit Service 4684c1
# Auto-generated files:
Packit Service 4684c1
 Several parts of the documentation and the command line tools parameters
Packit Service 4684c1
files (.def) are auto-generated. Normally when introducing new functions,
Packit Service 4684c1
or adding new command line options to tools you need to run 'make
Packit Service 4684c1
files-update', review the output (when feasible) and commit it separately,
Packit Service 4684c1
e.g., with a message: "auto-generated files update".
Packit Service 4684c1
Packit Service 4684c1
Packit Service 4684c1
# Guile bindings:
Packit Service 4684c1
Packit Service 4684c1
 Parts of the Guile bindings, such as types (aka. "SMOBs"), enum values,
Packit Service 4684c1
constants, are automatically generated.  This is handled by the modules
Packit Service 4684c1
under `guile/modules/gnutls/build/'; these modules are only used at
Packit Service 4684c1
build-time and are not installed.
Packit Service 4684c1
Packit Service 4684c1
The Scheme variables they generate (e.g., constants, type predicates,
Packit Service 4684c1
etc.) are exported to user programs through `gnutls.scm' and
Packit Service 4684c1
`gnutls/extra.scm', both of which are installed.
Packit Service 4684c1
Packit Service 4684c1
For instance, when adding/removing/renaming enumerates or constants,
Packit Service 4684c1
two things must be done:
Packit Service 4684c1
Packit Service 4684c1
 1. Update the enum list in `build/enums.scm' (currently dependencies
Packit Service 4684c1
    are not tracked, so you have to run "make clean all" in `guile/'
Packit Service 4684c1
    after).
Packit Service 4684c1
Packit Service 4684c1
 2. Update the export list of `gnutls.scm' (or `extra.scm').
Packit Service 4684c1
Packit Service 4684c1
Note that, for constants and enums, "schemefied" names are used, as
Packit Service 4684c1
noted under the "Guile API Conventions" node of the manual.
Packit Service 4684c1
Packit Service 4684c1
# Automated testing
Packit Service 4684c1
Packit Service 4684c1
 GnuTLS primarily relies on gitlab-ci which is configured in .gitlab-ci.yml
Packit Service 4684c1
file in the repository. The goal is to have a test suite which runs for
Packit Service 4684c1
every new merge request prior to merging. There are no particular rules for
Packit Service 4684c1
the test targets, except for them being reliable and running in a reasonable
Packit Service 4684c1
timeframe (~1 hour).
Packit Service 4684c1
Packit Service 4684c1
Packit Service 4684c1
# Reviewing code
Packit Service 4684c1
Packit Service 4684c1
 A review as part of the gitlab merge requests, is a way to prevent errors due to
Packit Service 4684c1
these guidelines not being followed, e.g., verify there is a reasonable test suite,
Packit Service 4684c1
and whether it covers reasonably the new code, that the function naming is
Packit Service 4684c1
consistent with these guidelines, as well as check for obvious mistakes in the new
Packit Service 4684c1
code.
Packit Service 4684c1
Packit Service 4684c1
The intention is to keep reviews lightweight, and rely on CI for tasks such
Packit Service 4684c1
as compiling and testing code and features.
Packit Service 4684c1
Packit Service 4684c1
A proposed checklist to assist such reviews follows.
Packit Service 4684c1
 * [ ] Any issues marked for closing are addressed
Packit Service 4684c1
 * [ ] There is a test suite reasonably covering new functionality or modifications
Packit Service 4684c1
 * [ ] Function naming, parameters, return values, types, etc., are consistent and according to `CONTRIBUTION.md`
Packit Service 4684c1
 * [ ] This feature/change has adequate documentation added
Packit Service 4684c1
 * [ ] No obvious mistakes in the code
Packit Service 4684c1
Packit Service 4684c1
Packit Service 4684c1
[Guidelines to consider when reviewing.](https://github.com/thoughtbot/guides/tree/master/code-review)