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

Added version-check to CI #543

Closed
wants to merge 85 commits into from
Closed

Added version-check to CI #543

wants to merge 85 commits into from

Conversation

dheerajd5
Copy link
Contributor

This PR adds a version-check to CI checks. It takes the version fetched from git and from the file version.h and compares it.
#497

@gavv
Copy link
Member

gavv commented Aug 30, 2023

Thanks for PR! Will review it in upcoming days.

@gavv gavv added the ready for review Pull request can be reviewed label Aug 30, 2023
@adrianopol adrianopol self-requested a review August 31, 2023 08:55
exit 1
else
echo "version check OK"
fi
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No newline at end of file

:)

Comment on lines 11 to 16
echo
echo "version check FAILED"
echo "the git tag name and version declared in version.h is not the same"
echo "${tagname} git version tag"
echo "${header_tagname} header version tag"
echo
Copy link
Member

@adrianopol adrianopol Aug 31, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

echo >&2 is preferred here, I assume

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey so in the other CI check scripts, such as check-formatting , echo is used, even for error messages, should I stick with that or make the change to echo >&2 ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dheerajd5 , hello, this behavior is preferred, yes, as soon as it doesn't break the script's functionality.

scripts/ci_checks/linux-checks/check-version.sh Outdated Show resolved Hide resolved

tagname=$(git tag -l)
tagname=${tagname: -5}
header_tagname=$(python3 scripts/scons_helpers/parse-version.py)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

more secure way:

Suggested change
header_tagname=$(python3 scripts/scons_helpers/parse-version.py)
header_tagname="$(python3 scripts/scons_helpers/parse-version.py)"

header_tagname=$(python3 scripts/scons_helpers/parse-version.py)

if [[ "$tagname" != "$header_tagname" ]]; then
echo
Copy link
Member

@adrianopol adrianopol Aug 31, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: common indentation size in shell scripts is 2 spaces

echo "${header_tagname} header version tag"
echo
exit 1
else
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
else
else

Copy link
Member

@adrianopol adrianopol Aug 31, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BTW, else is useless here (as soon as you do exit in the first branch)

echo
exit 1
else
echo "version check OK"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit:

Suggested change
echo "version check OK"
echo "version check SUCCEEDED"

@adrianopol adrianopol added the needs revision Pull request should be revised by its author label Aug 31, 2023
@gavv gavv removed the ready for review Pull request can be reviewed label Aug 31, 2023
dheerajd5 and others added 22 commits September 1, 2023 09:19
Co-authored-by: Andrew <4029800+adrianopol@users.noreply.github.com>
- rename roc_frame_encoding to roc_format
  (format is lower level setting compared to encoding;
   encoding defines format, channels, and rate)

- remove remove packet_sample_rate and packet_channels
  (this parameters are derived from packet encoding)
- replace two fields max_latency_overrun and max_latency_underrun
  with a single field latency_tolerance

- rename broken_playback_timeout to choppy_playback_timeout

- remove breakage_detection_window
  (derive reasonable value from choppy_playback_timeout)
- add ChannelLayout, which defines meaning of channel numbers
  (mono, stereo, surround, multitrack)

- add ChannelSet, which replaces channel_mask_t, and supports
  larger number of channels (up to 256 instead of 32)

- add ChannelPosition, that identifies channel numbers for
  surround sound (currently only L and R)

- use ChannelSet instead of channel_mask_t everywhere, including
  SampleSpec and ChannelMapper

- upgrade ChannelMapper to properly map between different layouts
  (mono, stereo, multitrack)

Surround sound is not fully supported yet: only L and R channels
are currently available in surround layout.
- make SlabPool template class
- add template parameter EmbeddedCapacity
- extract implementation to non-template class SlabPoolImpl
  to avoid code size growth
- rename FormatMap::format() to FormatMap::find_by_pt()
- add FormatMap::find_by_spec()
- add FormatMap::add_format()
- use SlabPool instead of Array to allocate formats (this allows
  safely returning pointers to formats to callers)
- use Hashmap to search formats (for speedup)
- make FormatMap thread-safe
- move FormatMap from Sender/Receiver to Context

These preparations will allow to implement C API for registering
custom formats (e.g. with sample rate not covered by built-in formats).
- rename roc_channel_set to roc_channel_layout
  (because now it will define not only list of
   enabled channels, but also meaning of those
   channels, i.e. mono vs surround vs multitrack)

- support two layouts:
   ROC_CHANNEL_LAYOUT_MONO
   ROC_CHANNEL_LAYOUT_STEREO

- support two packet encodings:
   ROC_PACKET_ENCODING_AVP_L16_MONO
   ROC_PACKET_ENCODING_AVP_L16_STEREO

- if packet_encoding is not set, automatically
  choose packet encoding that matches frame encoding
(for consistency with recent renames in C API)
- add roc_media_encoding struct which defines rate, channels,
  and format

- use it in roc_sender_config and roc_receiver_config instead of
  multiple fields
Add new method roc_context_register_encoding(), that allows to
register custom encodings on sender and receiver.

It is useful when user needs to force custom packet encodings, but
doesn't use signaling protocols (like RTSP), and instead wants to
use static encodings table or manage signalling manually.
gavv and others added 19 commits September 1, 2023 09:33
- change load factor from Java to Go variant
- allow constructing hashmap without arena
- do not implicitly grow hashmap in constructor
- ensure that number of elements defined by EmbeddedCapacity can
  be always allocated without arena
- add corresponding tests
Add to new function roc_sender_unlink() and roc_receiver_unlink()
which allow to disconnect and remove previously created slots.
- if error happens during configure, bind, or connect, the whole
  slot is disabled and marked broken

- broken slot is excluded from pipeline, and its sockets
  are closed

- broken port still keeps slot number reserved

- user should unlink broken slots to free remaining resources
  and allow slot index reuse

- new logic is covered with tests

- detailed tests for error handling are moved from public_api
  level to roc_peer level because there we have more information
- rename roc_peer module to roc_node, because we're going to
  add pipelines that are not network peers

- use term "node" instead of "peer" everywhere
Co-authored-by: Andrew <4029800+adrianopol@users.noreply.github.com>

Code Review changes

Clean up commit
@dheerajd5
Copy link
Contributor Author

Hey, I rebased over existing commits by mistake, I'll put up a new PR with the code reviewed changes.

@dheerajd5 dheerajd5 closed this Sep 1, 2023
@adrianopol
Copy link
Member

Hi, there is no need to close this one, you may just fix your branch locally (e.g. rebase on roc-streaming:develop branch) and then make git push -f.

@dheerajd5
Copy link
Contributor Author

Oh, sorry I'm new to this, I'll keep it in mind next time.

@adrianopol
Copy link
Member

no problem, thank you!

@gavv gavv added duplicate Already addressed by another issue or pull request and removed needs revision Pull request should be revised by its author labels Sep 6, 2023
@gavv gavv added reopened moved Transitioned to another issue or pull request and removed duplicate Already addressed by another issue or pull request reopened labels Oct 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
moved Transitioned to another issue or pull request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants