guness / bitrise-step-firebase-app-distribution

Upload your apps to Firebase and sends email to your testers.
MIT License
35 stars 28 forks source link

Release notes length exceeds maximum character limit #45

Closed odemolliens closed 2 years ago

odemolliens commented 2 years ago

I know you closed the two previous ticket.

The minimun is to offer to users of that step to be able to activate the string truncate by a simple boolean. Regarding the maximun lentgh, make it parametable.

Isn't simple? Currently this step is unusable without adding extra code...

I'm just the 3rd developer to request that feature... so it's time to listen us :)

guness commented 2 years ago

Well, I don't like it but will add a new parameter that limits the input. It is your burden to configure the params and watch the changes on firebase API. :)

odemolliens commented 2 years ago

For sure ;)

odemolliens commented 2 years ago

FYI code from the MR https://github.com/guness/bitrise-step-firebase-app-distribution/pull/42 is working fine.

I tested it with:

                MAX_RELEASE_NOTES_LENGTH=16379

                function truncate_release_notes {
                  release_notes=$1
                  original_length=${#release_notes}
                  if (( $original_length > $MAX_RELEASE_NOTES_LENGTH )); then
                    end_message="..."
                    cut_limit=$(($MAX_RELEASE_NOTES_LENGTH-${#end_message}))
                    echo "${release_notes:0:$cut_limit}${end_message}"
                  else
                    echo "${release_notes}"
                  fi
                }

                ENV_FIREBASE_RELEASE_NOTES=$(truncate_release_notes "My release note text")

16379 as length because of the end_message var with "...". Solved the REST API issue

guness commented 2 years ago

this is the related PR: https://github.com/bitrise-io/bitrise-steplib/pull/3376